Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n=0;
- int estado=0;
- void setup(){
- Serial.begin(9600);
- pinMode(3, INPUT);
- }
- void loop(){
- if (digitalRead(3)==HIGH && estado==0){
- n++;
- estado=1;
- Serial.println(n);
- }
- if (digitalRead(3)==LOW){
- estado=0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement