Added examples folder with a simple example script (LCD library missing!)

This commit is contained in:
BlueFox 2024-10-28 19:18:36 +00:00
parent 18d25df898
commit 24e0d7e7be

18
examples/basic.py Normal file
View File

@ -0,0 +1,18 @@
from WelcomeScreen import WelcomeScreen
from machine import I2C, Pin
from PCF8574T import I2C_LCD
LCD_SDA = Pin(8) # just some standard I2C serial data (SDA) outputs (on I2C channel 0 on Pi Pico)
LCD_SCL = Pin(9) # just some standard I2C serial clock (SCL) outputs (on I2C channel 0 on Pi Pico)
LCD_I2C_ADDR = 0x27 # the i2c adress of the display (yours might be different to this one)
LCD_I2C_NUM_ROWS = 2 # how many rows for character display has the display?
LCD_I2C_NUM_COLS = 16 # and how many characters can it display per row?
LCD = I2C_LCD(I2C(0, sda=LCD_SDA, scl=LCD_SCL, freq=400000),
LCD_I2C_ADDR,
LCD_I2C_NUM_ROWS,
LCD_I2C_NUM_COLS)
ws = WelcomeScreen(LCD)
ws.show()
lcd.putstr("Now your program")