Whandall:
#include <Bounce2.h> //https://github.com/thomasfredericks/Bounce2
const byte buttonPin = 2;
const byte ledPin = 12;
const unsigned long onTime = 100;
enum LedState {
ledOff,
ledOn,
ledBlink,
};
Bounce button;
byte ledState = ledOff;
unsigned long lastLedMillis;
void setup() {
pinMode(ledPin, OUTPUT);
button.attach(buttonPin, INPUT_PULLUP);
}
void loop () {
if (button.update()) { // button activity?
if (button.fell()) { // press event?
if (++ledState > ledBlink) { // next state, wrap
ledState = ledOff;
}
switch (ledState) {
case ledOff:
digitalWrite(ledPin, LOW);
break;
case ledBlink:
lastLedMillis = millis();
//fall through
case ledOn:
digitalWrite(ledPin, HIGH);
break;
}
}
}
if (ledState == ledBlink && (millis() - lastLedMillis > onTime)) {
lastLedMillis = millis();
digitalWrite(ledPin, !digitalRead(ledPin));
}
}
WooooooWWWW than's a looot !! But how i can include <Bounce2.h> ? i go on the website and i try tu copy/paste the code in the program but don't works
i just need to download a file ? how i intergrated it ?
I made this montage but is not the same what i make in Protheus (in proteus the montage work's fine)