LightHub 4.6.0
Open-source smart home controller firmware
Loading...
Searching...
No Matches
bright.h File Reference
#include <Arduino.h>

Go to the source code of this file.

Macros

#define BRIGHT_LINEAR
 Default brightness curve: linear mapping of percent to 8-bit value.

Functions

uint8_t getBright255 (uint8_t percent255)
 Convert a 0..255 brightness percentage to an 8-bit output value.

Macro Definition Documentation

◆ BRIGHT_LINEAR

#define BRIGHT_LINEAR

Default brightness curve: linear mapping of percent to 8-bit value.

Function Documentation

◆ getBright255()

uint8_t getBright255 ( uint8_t percent255)

Convert a 0..255 brightness percentage to an 8-bit output value.

Uses the active brightness curve: a straight passthrough when BRIGHT_LINEAR is set, otherwise a perceptual (log/step) lookup table so low brightness steps feel smoother to the eye.

Parameters
percent255Brightness percentage in 0..255.
Returns
The 8-bit brightness value to apply to the output.