Untitled
unknown
plain_text
a year ago
591 B
4
Indexable
void loop(){ // Check button status int etatBouton = digitalRead(BOUTON_PIN); if (etatBouton == HIGH && lastStateBouton == LOW){ // On vient d'appuyer } else if (etatBouton == HIGH && lastStateBouton == HIGH){ // On est toujours enfoncé } else if (etatBouton == LOW && lastStateBouton == HIGH){ // On vient de relacher } else if (etatBouton == LOW && lastStateBouton == LOW){ // On est toujours relaché } lastStateBouton = etatBouton; // Check if it's time to publish delay(10); }
Editor is loading...
Leave a Comment