Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int ana=0;
- int P=0;
- int M=0;
- int angle=0;
- int et=0;
- #include <Servo.h>
- Servo esc ;
- void setup()
- {pinMode(22,INPUT); //22 : bouton poussoir pour le plus
- pinMode(23,INPUT); //23 : bouton poussoir pour le moins
- Serial.begin(9600);
- }
- void loop()
- { P = digitalRead(22); //P->plus : lit état bouton plus (pin 22)
- while(P==HIGH)
- {ana=ana+1;
- delay(1000);
- P = digitalRead(22);
- }
- Serial.print("ana");
- Serial.println(ana);
- while(M==HIGH)
- {ana=ana-1;}
- delay(100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement