elrincondearni

Led con mando 2

Jan 31st, 2014
749
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. int conta=0;
  2.  
  3. void setup() {
  4. pinMode(2, OUTPUT);
  5. pinMode(3, INPUT);
  6. }
  7.  
  8. void loop() {
  9. if (digitalRead(3)) {
  10. conta=1-conta;
  11. digitalWrite(2, conta);
  12. delay(100);
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment