Hardware Timer ESP32 Dev Module - Arduino Forum
Continuing the discussion from Hardware Timer ESP32 Dev Module:. #include <Arduino. h> #include "esp32-hal-timer. h" hw_timer_t * timer = NULL; volatile int counter = 0; const int clockPin = 18; GPIO pin for clock output #define TIMER_INTERVAL_MICROS 1 #define BIT_8_DELAY_MICROS 4. 4 void IRAM_ATTR onTimer() { digitalWrite(clockPin, counter % 2); Toggle clockPin HIGH or LOW counter++; if . . .
more
|