pdf-icon

Arduino Quick Start

TimerCAM Wakeup

cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#include "M5TimerCAM.h"
void led_breathe(int ms) {
for (int16_t i = 0; i < 255; i++) {
TimerCAM.Power.setLed(i);
vTaskDelay(pdMS_TO_TICKS(ms));
}
for (int16_t i = 255; i >= 0; i--) {
TimerCAM.Power.setLed(i);
vTaskDelay(pdMS_TO_TICKS(ms));
}
}
void setup() {
TimerCAM.begin(true);
Serial.println("Wake up!!!");
led_breathe(10);
// sleep after 5s wakeup!
TimerCAM.Power.timerSleep(5);
}
void loop() {
}
On This Page