pdf-icon

Arduino Quick Start

2. Devices & Examples

TimerCAM LED

cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include "M5TimerCAM.h"

void setup() {
    TimerCAM.begin();
}

void loop() {
    for (int16_t i = 0; i < 255; i++) {
        TimerCAM.Power.setLed(i);
        vTaskDelay(pdMS_TO_TICKS(10));
    }

    for (int16_t i = 255; i >= 0; i--) {
        TimerCAM.Power.setLed(i);
        vTaskDelay(pdMS_TO_TICKS(10));
    }
}
On This Page