Georg schrieb:
Hallo Workwind,
gibt es bei der NIBO2-Arduino-Lib eine Funktion/Möglichkeit, womit man den Taster S3 abfragen kann?
lg
Georg
PS.: Ich habe schon eine Lösung gefunden:
#include <NIBO_NDS3.h>
#include <NIBO_GFX.h>
#include <NIBO2.h>
#include <Bounce.h>
// Instantiate a Bounce object with a 20 millisecond debounce time
Bounce bouncer = Bounce(IO_INPUT1,20 ); // IO_INPUT1 = Taster S3
void setup() {
NIBO2.begin();
pinMode(28,INPUT);
}
void loop() {
// Update the debouncer
bouncer.update();
// Get the update value
int value = bouncer.read();
// Turn on or off the LED
if ( value == HIGH) {
NIBO2.setLed(3,LED_GREEN);
} else {
NIBO2.setLed(3,LED_RED);
}
}