I followed these instructions successfully, so I was able to get the Raspberry Pi to send "HELLO\n" to my Arduino Mega 2560 over USB and print to Serial console.
I have installed Open CV successfully on my Raspberry Pi using these steps and successfully tested camshiftdemo.c with my web camera on the pi.
Now I would like to execute camshiftdemo on the pi and get it to send "TURN LEFT\n" or "TURN RIGHT\n" strings to a 4-wheel rover. The rover is attached to my Arduino Mega 2560.
So basically, Raspberry Pi runs camshiftdemo.c, tracks an random object of user's choosing. Then camshiftdemo draws an ellipse around the chosen object as it is moving. If the object drifts to the left side of the web camera, the Raspberry Pi sends "TURN LEFT\n" to the arduino, causing the wheels of rover to turn left. If the object drifts to the right side of the web camera, the Raspberry Pi sends "TURN RIGHT\n" to the arduino, causing the wheels of the rover to turn right.
The camshiftdemo code is written in C and the first link above shows how to use Python to send simple ASCII commands to an arduino over USB. How do I combine camshiftdemo.c and Python to work together? Specifically, how can I modify "camshiftdemo.c" to execute python code from the C program?
Would greatly appreciatea all / any advise.