Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Desenvolvido por Duds Tecnologia
- */
- int contador = 0;
- bool inativo = false;
- void setup() {
- Serial.begin(9600);
- }
- void loop() {
- int leitura = digitalRead(2);
- if (!leitura && inativo) {
- contador++;
- inativo = false;
- }
- if (!inativo && leitura) {
- inativo = true;
- }
- Serial.print("Contador: ");
- Serial.println(contador);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement