You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -42,20 +40,23 @@ The ``Character_LCD`` class interfaces a predefined Character LCD display with C
42
40
43
41
.. code-block:: python
44
42
45
-
import adafruit_character_lcd
43
+
import board
44
+
import digitalio
45
+
import adafruit_character_lcd.character_lcd as character_lcd
46
46
47
47
You must define the data pins (``RS``, ``EN``, ``D4``, ``D5``, ``D6``, ``D7``) in your code before using the ``Character_LCD`` class.
48
-
If you want to have on/off ``backlight`` functionality, you can also define your backlight as ``lcd_backlight``. Otherwise, the backlight will always remain on. An example of this is below
48
+
If you want to have on/off ``backlight`` functionality, you can also define your backlight as ``lcd_backlight``. Otherwise, the backlight
49
+
will always remain on. The following is an example setup.
49
50
50
51
.. code-block:: python
51
52
52
-
lcd_rs = digitalio.DigitalInOut(D7)
53
-
lcd_en = digitalio.DigitalInOut(D8)
54
-
lcd_d7 = digitalio.DigitalInOut(D12)
55
-
lcd_d6 = digitalio.DigitalInOut(D11)
56
-
lcd_d5 = digitalio.DigitalInOut(D10)
57
-
lcd_d4 = digitalio.DigitalInOut(D9)
58
-
lcd_backlight = digitalio.DigitalInOut(D13)
53
+
lcd_rs = digitalio.DigitalInOut(board.D7)
54
+
lcd_en = digitalio.DigitalInOut(board.D8)
55
+
lcd_d7 = digitalio.DigitalInOut(board.D12)
56
+
lcd_d6 = digitalio.DigitalInOut(board.D11)
57
+
lcd_d5 = digitalio.DigitalInOut(board.D10)
58
+
lcd_d4 = digitalio.DigitalInOut(board.D9)
59
+
lcd_backlight = digitalio.DigitalInOut(board.D13)
59
60
60
61
You must also define the size of the CharLCD by specifying its ``lcd_columns`` and ``lcd_rows``:
61
62
@@ -68,17 +69,17 @@ After you have set up your LCD, we can make the device by calling it
0 commit comments