SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
aw9364_led.ino
Go to the documentation of this file.
1
29#include <Arduino.h>
30#include <AW9364LedDriver.hpp>
31
32#ifdef ENABLE_TFT
33#include "TFT_eSPI.h"
34TFT_eSPI tft;
35#endif
36
37// Drive LED pin
38#define BACKLIGHT_PIN 2
39
41
42uint8_t level = 0;
43
44void setup()
45{
46 Serial.begin(115200);
47
48#ifdef ENABLE_TFT
49 tft.begin();
50 tft.setRotation(1);
51 tft.fillScreen(TFT_GREEN);
52#endif
53
54 // Initialize LED driver
56}
57
58void loop()
59{
60 // 16 dimming levels
61 Serial.print("level:");
62 Serial.println(level);
64 level++;
66 delay(1000);
67}
68
69
70
constexpr uint8_t MAX_BRIGHTNESS_STEPS
Maximum brightness steps (0‑16).
AW9364LedDriver ledDriver
void setup()
uint8_t level
#define BACKLIGHT_PIN
void loop()
Controls LED brightness by generating a specific number of pulses on a GPIO pin.
void setBrightness(uint8_t value)
Set the LED brightness level.
void begin(uint8_t pin)
Initialize the driver for use with a native Arduino pin.