Initialise the I2C bus and run the LCD1602 startup sequence. Idempotent: returns immediately if already initialised. Auto-detects I2C address if the configured one is unreachable.
(self, *args)
| 84 | # ------------------------------------------------------------------ |
| 85 | |
| 86 | def init(self, *args): |
| 87 | """Initialise the I2C bus and run the LCD1602 startup sequence. |
| 88 | |
| 89 | Idempotent: returns immediately if already initialised. |
| 90 | Auto-detects I2C address if the configured one is unreachable. |
| 91 | """ |
| 92 | if self._initialized: |
| 93 | return |
| 94 | self._open_bus() |
| 95 | self._addr = self._detect_address() |
| 96 | self._init_sequence() |
| 97 | self._initialized = True |
| 98 | logger.info( |
| 99 | "LCD1602 initialised (%dx%d) at I2C 0x%02X bus %d", |
| 100 | self.width, self.height, self._addr, self._bus_num, |
| 101 | ) |
| 102 | |
| 103 | def Clear(self): |
| 104 | """Clear the display and return cursor to home.""" |
no test coverage detected