Programmatic access to Adafruit LCD over USB from Pi (B)

Hi,

Finally managed to try my first hand at soldering today and get the Adafrui t LCD connected up the RaspPi 'B' via USB... By default it runs the 'lcdpro c' application on startup (from a call in the rc.local file)...

Now I need to figure out what is the best way to programmatically access th is LCD using code (Python?)... I've been googling around and only seen Pyth on access to LCD's via the GPIO pins... Anyone know how this can be done ov er the USB? Obviously the 'lcdproc' application is doing it so it must be p ossible...

Thanks in advance Rick

Reply to
Rick Behl
Loading thread data ...

Short answer: Open the relevant USB port in your choosen language and write to it. B-)

Longer answer: You'll probably have to scan an OS database looking for the maker and product ID of the display to find the USB port that the display is plugged into, there may be initialisation of the port required based on information in the DB (power level?), once opened there maybe initialisation of the display required, set mode (maybe graphical v text), chracter set. etc.

--
Cheers 
Dave.
Reply to
Dave Liquorice

Which LCD?

This one:

formatting link

I've not used it, but I'm sure it's easy to do - these things just look like a USB serial port to Linux - /dev/ttyUSB0 or (probably) /dev/ttyACM0.

You need to open the serial port and send the data to it. It would not surprise me if that one just took characters and put them on the display. I suspect you can simple run

minicom -D /dev/ttyACM0

and type at it. The manual pages:

formatting link

indicate that to do special stuff you send it a series of control codes starting with 0xFE ..

That is trivial to drive from a C program, so ought to be even easier from Python.

you might need to kill-off the lcdproc program first though.

Gordon

Reply to
Gordon Henderson

Or just talk to lcdproc via it's TCP/IP port and let it worry about the USB port bashing. B-)

You can have multiple clients talking to the same lcdproc server (aka display) and it will cycle through each screen from each client. A client can raise an "urgent" flag and have it's output displayed straight away. Laying out screens is a bit easier. Probably have control of the backlight and contrast as well, depends on the driver lcdproc is using and of course te capabilty of the hardware.

--
Cheers 
Dave.
Reply to
Dave Liquorice

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.