]>
vault307.fbx.one Git - RPI-PICO-I2C-LCD.git/blob - main.py
3 from machine
import I2C
4 from lcd_api
import LcdApi
5 from pico_i2c_lcd
import I2cLcd
12 """Test function for verifying basic functionality."""
13 print("Running test_main")
14 i2c
= I2C(0, sda
=machine
.Pin(0), scl
=machine
.Pin(1), freq
=400000)
15 lcd
= I2cLcd(i2c
, I2C_ADDR
, I2C_NUM_ROWS
, I2C_NUM_COLS
)
16 lcd
.putstr("It Works!\nSecond line!\nThird Line!\nFourth Line!")
22 lcd
.putstr("%7d" % (utime
.time() // 1000))
24 print("Turning cursor on")
27 print("Turning cursor off")
30 print("Turning blink cursor on")
33 print("Turning blink cursor off")
34 lcd
.blink_cursor_off()
36 print("Turning backlight off")
39 print("Turning backlight on")
42 print("Turning display off")
45 print("Turning display on")
48 print("Filling display")
51 for x
in range(32, 32+I2C_NUM_ROWS
*I2C_NUM_COLS
):
57 #if __name__ == "__main__":