Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define Ae 3
- #define Be 4
- #define Ce 5
- int leitura3a;
- unsigned int contEsq3;
- unsigned int auxValorEsq;
- byte Flag;
- #include <LiquidCrystal.h>
- LiquidCrystal lcd3(12, 11, 9, 8, 7, 6);
- //---------------------------------
- void setup()
- {
- Serial.begin(9600);
- }
- //---------------------------------
- void loop()
- {
- leitura3a = digitalRead(Ae) & !digitalRead(Be) & !digitalRead(Ce);
- if ((leitura3a == 1) && (Flag == 0))
- {
- Flag = 1;
- // Incrementa o valor do contador
- contEsq3 = contEsq3 + 1;
- // Apaga o valor anterior
- lcd3.setCursor(0, 1);
- lcd3.print(" ");
- // Mostra o valor do contador
- lcd3.setCursor(0, 1);
- lcd3.print(contEsq3);
- auxValorEsq = contEsq3;
- }
- if (leitura3a == 0) Flag = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement