diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-10-28 21:08:06 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-10-28 21:08:06 -0300 |
| commit | 0c5b080efac82b1d196e3dde00e5950c97ecbb68 (patch) | |
| tree | 9cab7ac15860270014c45f76c661d50e5be689f2 /esp/src/lm393.cpp | |
| parent | 7ccab61c22fafb3bb9fa5470ff8cb46217111fe4 (diff) | |
feat:leitura assÃncrona de leitores
Diffstat (limited to 'esp/src/lm393.cpp')
| -rw-r--r-- | esp/src/lm393.cpp | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/esp/src/lm393.cpp b/esp/src/lm393.cpp deleted file mode 100644 index 5eb4bdf..0000000 --- a/esp/src/lm393.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include <Arduino.h> -#include "lm393.h" - -#define SENSOR_PIN 32 // ou 35 se preferir - -void setupLM393() { - pinMode(SENSOR_PIN, INPUT); -} - -int lerLM393() { - static int contagem = 0; - static unsigned long lastTime = 0; - - if (digitalRead(SENSOR_PIN) == LOW) { - contagem++; - delay(10); - } - - if (millis() - lastTime >= 1000) { - int pulsos = contagem; - contagem = 0; - lastTime = millis(); - return pulsos; - } - return 0; -} |
