Hi Honda
Code is a Python script from Hobbytronics LCD backpack
- Code: Select all
import serial
import time
serialport = serial.Serial("/dev/ttyAMA0", 9600, timeout=5)
time.sleep(1)
serialport.write(chr(5)+chr(2)+chr(16)+chr(0xFF))
serialport.write(chr(4)+chr(0xFF))
serialport.write(chr(7)+chr(250)+chr(0xFF))
serialport.write(chr(2)+chr(1)+chr(1)+chr(0xFF))
serialport.write(chr(1)+"Welcome to"+chr(0xFF))
serialport.write(chr(2)+chr(2)+chr(1)+chr(0xFF))
serialport.write(chr(1)+"Raspberry LCD"+chr(0xFF))
count = 0
while 1 :
serialport.write(chr(2)+chr(1)+chr(13)+chr(0xFF))
serialport.write(chr(1)+str(count)+chr(0xFF))
time.sleep(1)
count = count + 1
serialport.close()
I an trying to do something like the Piface but on USB. Its been 25 years since I wrote any code, so you will have to bare with me.
Thanks
Hall