- Tue May 24, 2022 4:26 pm
#233556
Here is my sketch...
FTR, I can even touch the button leg with the leg of a resistor while the other leg is in my hand to get the same effect...
The schematic shows the button is a short to GND when pressed, so I assume D10 should have a builtin pull-up to Vcc.
Is this a board defect, or am I doing something wrong?
Code: Select all
The LED flashes when I check the button with my multimeter (leg closest to the battery JST connector), however it doesn't work when I simply press the user button (10).#define BUTTON 10
void buttonISR () {
isr_fired = true;
}
void setup () {
::pinMode(LED_BUILTIN, OUTPUT);
::pinMode(BUTTON, INPUT_PULLUP);
::attachInterrupt(digitalPinToInterrupt(BUTTON), buttonISR, RISING);
}
void loop () {
if (isr_fired) {
isr_fired = false;
::digitalWrite(LED_BUILTIN, HIGH);
::delay(250);
}
::digitalWrite(LED_BUILTIN, LOW);
}
FTR, I can even touch the button leg with the leg of a resistor while the other leg is in my hand to get the same effect...
The schematic shows the button is a short to GND when pressed, so I assume D10 should have a builtin pull-up to Vcc.
Code: Select all
FWIW, I can reproduce this behavior while the board is powered from USB, a battery via the JST, or both at the same time.D10 ___ \____ GND
USER
Is this a board defect, or am I doing something wrong?