Big Dome Box

From air
Jump to navigation Jump to search
Big Dome Box

Matériel

Design

Logiciel

Emergency Logout

http://www.arduino.cc/en/Tutorial/KeyboardLogout

const int domeButton = 12; const int domeLed = 13; boolean flag=false;

void setup() {

 pinMode(domeLed, OUTPUT);
 pinMode(domeButton, INPUT_PULLUP);
 Keyboard.begin();

}

void loop() {

 if (!flag && digitalRead(domeButton) == HIGH) {
   digitalWrite(domeLed, HIGH);
   Keyboard.print(" ");
   delay(100);
   Keyboard.releaseAll();
   flag=true;
 }
 if (flag && digitalRead(domeButton) == LOW) {
   digitalWrite(domeLed, LOW);
   delay(100);
   Keyboard.releaseAll();
   flag=false;
 }

}