Skip to content

Commit

Permalink
Create import time from machine import I2C, Pin from I2C_LCD import I…
Browse files Browse the repository at this point in the history
…2CLcd # 8574AT chip = 0x3F address i2c = I2C(0, sda=Pin(4), scl=Pin(5), freq=400000) devices = i2c.scan() lcd = I2CLcd(i2c, devices[0], 4, 20) lcddata=["","Welcome ","to ","Pico "] def lcdfeed(new): try: if devices != []:self.lcddata.append(new) self.lcddata.pop(0) for x in range(0,3) self.lcd.move_to(0, x) self.lcd.putstr(lcddata[x]) else: print("No address found") except: pass

Add LCDFeed.py
  • Loading branch information
Danielerikrust authored Feb 21, 2023
0 parents commit c014cf1
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import time
from machine import I2C, Pin
from I2C_LCD import I2CLcd

i2c = I2C(0, sda=Pin(4), scl=Pin(5), freq=400000) # 8574AT chip = 0x3F address
devices = i2c.scan()
lcd = I2CLcd(i2c, devices[0], 4, 20) # Assumes only LCD is connected

lcddata=["","Welcome ","to ","Pico "]

def lcdfeed(new):
try:
if devices != []:self.lcddata.append(new)
self.lcddata.pop(0)
for x in range(0,3)
self.lcd.move_to(0, x)
self.lcd.putstr(lcddata[x])
else:
print("No device found")
except:
pass

0 comments on commit c014cf1

Please sign in to comment.