LCD Display using USB

Build/modify/repair equipment and improve systems performance by yourself

LCD Display using USB

Postby lomoss7 » 16 Feb 2015, 23:02

Hi

Gathering some info on getting a LCD track display to work using a ft232rl USB to serial board.
Run my code which (works on my other pi) and get this error
import serial
ImportError: No module named 'serial'

How do you import the serial module?

Thanks

Hall
lomoss7
 
Posts: 8
Joined: 29 Dec 2014, 15:50

Re: LCD Display using USB

Postby hondagx35 » 16 Feb 2015, 23:53

Hi lomoss7,

please give us more information.
- programming language
- code snipped
User avatar
hondagx35
 
Posts: 3041
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: LCD Display using USB

Postby lomoss7 » 21 Feb 2015, 15:33

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
lomoss7
 
Posts: 8
Joined: 29 Dec 2014, 15:50

Re: LCD Display using USB

Postby hondagx35 » 21 Feb 2015, 22:08

Hi lomoss7,

you need python and pySerial installed on runeaudio.

Code: Select all
pacman -S python2-pyserial


If this does not work take a look here.

Frank
User avatar
hondagx35
 
Posts: 3041
Joined: 11 Sep 2014, 22:06
Location: Germany

support RuneAudio Donate with PayPal


Return to DIY and tweaks

Who is online

Users browsing this forum: No registered users and 0 guests