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

Functions

uint8_t getBright255 (uint8_t percent255)
 Convert a 0..255 brightness percentage to an 8-bit output 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.