Describe the bug
The logic on "digitalWrite(LED_BUILTIN, 0)" is inverted, when I use an external led it works, but for the LED_BUILTIN it turns OFF the led with 1 and ON with 0.
To Reproduce
`#define botaoLigaDesliga A3
short ligado = 0;
unsigned long tempoPassadoBotao = 0;
Describe the bug The logic on "digitalWrite(LED_BUILTIN, 0)" is inverted, when I use an external led it works, but for the LED_BUILTIN it turns OFF the led with 1 and ON with 0.
To Reproduce
`#define botaoLigaDesliga A3 short ligado = 0; unsigned long tempoPassadoBotao = 0;
void setup() { pinMode(botaoLigaDesliga, INPUT_PULLDOWN); pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, ligado); }
void loop() { if (digitalRead(botaoLigaDesliga)) { if (millis() - tempoPassadoBotao >= 2000) { if (ligado) { ligado = 0; } else { ligado = 1; }
} }`
Steps to reproduce the behavior:
Expected behavior The led needs to be OFF with 0 and on with 1.
Desktop (please complete the following information):