I need help on displaying python script output on LCD.
I believe there is no direct way for Python (running on OpenWrt) to write on LCD controlled by ATmega proc. I assume I am correct here. Experts, please confirm.
Use Case:
I do have keypad based LCD shield (16x2 LCD from DF Robot) connected to yun board. I call different python script from Arduino sketch based on the key press on LCD shield (i.e. UP or Down or Left key etc). Each script gives some output which I wish to display on the LCD.
Problem:
Currently I don’t see any way for Python script to return a single/multi line string to Arduino sketch. So I thought of solution where respective python script would write data in output file and later arduino sketch would do FileIO to read/display the same.
I find this little cumbersome and redundant. My python and Arduino skills are limited so pardon any obvious mistake.
Nagesh:
I need help on displaying python script output on LCD.
I believe there is no direct way for Python (running on OpenWrt) to write on LCD controlled by ATmega proc. I assume I am correct here. Experts, please confirm.
::::SNIP::::
I find this little cumbersome and redundant. My python and Arduino skills are limited so pardon any obvious mistake.
@Nagesh,
funny you should request this. There are several LCDs that work with most Arduinos. I image quite a few with LCDs work with the Arduino Yun.
Tonight I am researching SPI (Serial Peripheral Interface) bus and the Yun. I find a tutorial that uses the SPI bus to drive an LCD display at instructables.
Arduino Yun Messager
I'm tired, and ready to fall asleep. I'll check back in about 20 hours. Others will pitch in if you have more questions.
Nagesh:
I call different python script from Arduino sketch based on the key press on LCD shield (i.e. UP or Down or Left key etc). Each script gives some output which I wish to display on the LCD.
This sounds like the classic use case for the Process object in the Bridge library. That class lets you run any Linux command, which in this case would be your Python script. Anything that the script prints to STDOUT before exiting will be sent back to the sketch. In Python, this includes anything displayed with a regular print call.
Take a look at the Process Tutorial. It runs a Linux command, then sends all output from the command to the serial port. You would use this idea to run the desired script, then when reading the returned data, instead of copying it to the serial port, you would write it to the display.