Advertisement
Forzaferrarileo

Untitled

Sep 5th, 2013
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1.  
  2.  
  3. bool pulsante=false
  4.  
  5. int i=1;
  6.  
  7. while(i<=10){
  8.  
  9. if((pulsante==false)&(!port->gpio_read(2))){
  10. port->gpio_write(27,1); //Γ¨ la sintassi per accendere il led sul pin 27
  11. pulsante=true;
  12. }
  13. else if((pulsante==true)&(!port->gpio_read(2))){
  14. port->gpio_write(20,1);
  15. pulsante=false;
  16. }
  17. }
  18.  
  19. /*
  20. port->gpio_read(2) Γ¨ la sintassi per leggere il pin 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement