]> vault307.fbx.one Git - garage_door_sensor.git/blob - lcd_test.py
update distanceLux.py to account for senstitivity of lux sensor
[garage_door_sensor.git] / lcd_test.py
1 from machine import I2C
2 from lcd_api import LcdApi
3 from pico_i2c_lcd import I2cLcd
4
5 # Define LCD I2C pins/BUS/address
6 SDA = 2
7 SCL = 3
8 I2C_BUS = 1
9 LCD_ADDR = 0x27
10
11 # Define LCD rows/columns
12 LCD_NUM_ROWS = 2
13 LCD_NUM_COLS = 16
14
15 # Set up LCD I2C
16 lcdi2c = I2C(I2C_BUS, sda=machine.Pin(SDA), scl=machine.Pin(SCL), freq=400000)
17 lcd = I2cLcd(lcdi2c, LCD_ADDR, LCD_NUM_ROWS, LCD_NUM_COLS)
18
19 # Show a string on the LCD
20 lcd.putstr("Hello, World!")
21
22 print("*********************************")
23 print("Display is now showing characters")
24 print("*********************************")