LEDs - tnl3pdx/SleepBud GitHub Wiki
For programming the WS2812B LEDs, the following libraries are used:
11/1/2024 (Truong)
TXS0108E - Logic Level Shifter
Used for 3.3V-5V level shifting for NRZ data to LEDs. Reference Datasheet: TXS0108E
- For schematic layout, looked into necessary external components for proper use.
- OE# pin needs to be tied to ground using pull-down resistor.
11/5/2024 (Truong)
LED Array Programming
- In total, 6 separate LED arrays need to be controlled by the ESP32
- 4 of these arrays are used to display the numbers on the digital clock.
- 1 of these arrays are used to display current mode when clicking the mode button
- 1 of these arrays are used for the lamp lighting
Custom Functions
- Using FastLED with custom functions as a wrapper will help with reducing the amount of code needed for a specific action.
- Action 1: Write a number to a 7-segment display
- Action 2: Select mode of clock on 2-segment display
- Action 3: Single-color lighting for lamp section
- (Opt) Action 4: Wait animations for WIFI connecting
11/16/2024 (Truong)
Using Hue-Saturation-Value for color
- FastLED provides both RGB and HSV color spectrums for addressing LEDs.
- For the use of individual LED arrays (total of 6), adjusting the brightness of an LED using value is much faster
Custom Function: convert hours and mins for 7 segment
- Using division and modulo, the hour and minute can be split into its places (in 10s and 1s).
- This data is then sent to a helper function that sets each LED based on the selected digit and number provided.
Custom Function: set auxiliary LEDs
- Due to the different manner of the configuration of setting up the 7-segment vs the mode/lamp LEDs, the function that housed both parts has now split into 2.