Turn the backlight on or off.
(self, on: bool = True)
| 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. |
no test coverage detected