Big Dome Box: Difference between revisions

From air
Jump to navigation Jump to search
Line 4: Line 4:
==Matériel==
==Matériel==
* [[Big Dome Push Button]]
* [[Big Dome Push Button]]
* [[MDF]] 6 mm / [[Contreplaqué]] 6 mm
* [[MDF]] 5 mm / [[Contreplaqué]] 5 mm
* [[Arduino]] Leonardo
* [[Arduino]] Leonardo



Revision as of 11:45, 9 December 2013

Big Dome Box

Matériel

Design

Logiciel

Emergency Logout

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

Spacebar for presentation, movie pause&resume, ...

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;
  }
}