From 24e0d7e7be048f3fa40eb4905bffe87f8e88ec41 Mon Sep 17 00:00:00 2001 From: BlueFox Date: Mon, 28 Oct 2024 19:18:36 +0000 Subject: [PATCH] Added examples folder with a simple example script (LCD library missing!) --- examples/basic.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 examples/basic.py diff --git a/examples/basic.py b/examples/basic.py new file mode 100644 index 0000000..5135745 --- /dev/null +++ b/examples/basic.py @@ -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") \ No newline at end of file