Ah, very nice.
And 6 more bytes! ? They all count!
Regarding pullups, this statement isn't exactly correct, but I think I understand where they are coming from:
"This effectively inverts the behavior of the INPUT mode, where HIGH means the sensor is off, and LOW means the sensor is on."
No, turning on pullups inside the ATmega328p does not effectively invert anything,
doesn't do anything different than adding an external resistor from that pin to 5v.
However, the resting state of that pin is then normally high and software reads a 1,?
software reads a 0 when we activate a switch or telegraph key that shorts the pin to ground.?
toggle quoted message
Show quoted text
On Sun, Oct 1, 2017 at 04:16 pm, Allard PE1NWL wrote:
Or even better:
//configure the PTT SENSE to use the internal pull-up
pinMode(PTT_SENSE, INPUT_PULLUP);
// check if PTT sense line is installed
PTTsense_installed = !digitalRead(PTT_SENSE);
pinMode(PTT_SENSE, INPUT); //disable the internal pull-up
saves 6 bytes.