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

Function _setBrightness

boards/m5stack-cplus2/interface.cpp:45–52  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

43** set brightness value
44**********************************************************************/
45void _setBrightness(uint8_t brightval) {
46 if (brightval == 0) {
47 analogWrite(TFT_BL, brightval);
48 } else {
49 int bl = MINBRIGHT + round(((255 - MINBRIGHT) * brightval / 100));
50 analogWrite(TFT_BL, bl);
51 }
52}
53
54/*********************************************************************
55** Function: InputHandler

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected