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

Method init

resources/waveshare_epd/lcd1602.py:86–101  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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."""

Callers 2

ClearMethod · 0.95
write_lineMethod · 0.95

Calls 4

_open_busMethod · 0.95
_detect_addressMethod · 0.95
_init_sequenceMethod · 0.95
infoMethod · 0.80

Tested by

no test coverage detected