MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / backlight

Method backlight

resources/waveshare_epd/lcd1602.py:127–134  ·  view source on GitHub ↗

Turn the backlight on or off.

(self, on: bool = True)

Source from the content-addressed store, hash-verified

125 self._send_data(ord(ch))
126
127 def backlight(self, on: bool = True):
128 """Turn the backlight on or off."""
129 self._backlight = _BL if on else 0x00
130 # Write a dummy byte to push the backlight state to the expander
131 try:
132 self._write_byte(self._backlight)
133 except Exception as exc:
134 logger.warning("LCD1602 backlight control failed: %s", exc)
135
136 def sleep(self):
137 """Turn off the display and backlight to save power.

Callers 1

sleepMethod · 0.95

Calls 2

_write_byteMethod · 0.95
warningMethod · 0.80

Tested by

no test coverage detected