MCPcopy Create free account
hub / github.com/BruceDevices/firmware / _setBrightness

Function _setBrightness

boards/m5stack-cardputer/interface.cpp:145–152  ·  view source on GitHub ↗

** Function: setBrightness ** location: settings.cpp ** set brightness value **********************************************************************/

Source from the content-addressed store, hash-verified

143** set brightness value
144**********************************************************************/
145void _setBrightness(uint8_t brightval) {
146 if (brightval == 0) {
147 analogWrite(TFT_BL, brightval);
148 } else {
149 int bl = MINBRIGHT + round(((255 - MINBRIGHT) * brightval / 100));
150 analogWrite(TFT_BL, bl);
151 }
152}
153
154/*********************************************************************
155** Function: InputHandler

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected