Advertisement
elrincondearni

Untitled

Apr 2nd, 2013
654
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. int cny=5;
  2. unsigned long cnyon;
  3. int led=13;
  4.  
  5. void setup (){
  6. pinMode (cny, INPUT);
  7. pinMode (led, OUTPUT);
  8. Serial.begin (9600);
  9. }
  10.  
  11. void loop () {
  12. cnyon= digitalRead (cny);
  13. Serial.println (cnyon);
  14. if (cnyon != 0){
  15. digitalWrite (led,HIGH);
  16. }
  17. else {
  18. digitalWrite (led, LOW);
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement