Skip to content

Commit 3f87b22

Browse files
authored
add I2C bus to README example
1 parent 1ec175e commit 3f87b22

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Currently there is only one such class: ``I2CPCF8574Interface``.
2020

2121
.. code-block:: python
2222
23+
import board
24+
2325
from lcd.lcd import LCD
2426
from lcd.i2c_pcf8574_interface import I2CPCF8574Interface
2527
@@ -28,7 +30,7 @@ Currently there is only one such class: ``I2CPCF8574Interface``.
2830
# Talk to the LCD at I2C address 0x27.
2931
# The number of rows and columns defaults to 4x20, so those
3032
# arguments could be omitted in this case.
31-
lcd = LCD(I2CPCF8574Interface(0x27), num_rows=4, num_cols=20)
33+
lcd = LCD(I2CPCF8574Interface(board.I2C(), 0x27), num_rows=4, num_cols=20)
3234
3335
lcd.print("abc ")
3436
lcd.print("This is quite long and will wrap onto the next line automatically.")

0 commit comments

Comments
 (0)