My project is a directional antenna which is mounted on a self-stabilizing base. The language I wish to use is python, but changing this to a more suited language, is a possibility, if needed.
Problem 1:
How would you go about taking in serial data in real-time[1], and then parse the data in python?
Problem 2:
How can I then send the output of the program to servos, which are mounted on the base? (feedback system).
[1](Fastest possible time for data transfer, processing and then output)
You can use the
pyserialmodule to read serial port data with Python. See: http://pyserial.sourceforge.net/shortintro.htmlHere’s a short usage example from the docs:
Next, you’ll need to parse the GPS data. Most devices support “NMEA 0183” format, and here’s another SO question with information about parsing that with Python: Parsing GPS receiver output via regex in Python
Finally, outputting data for servo control will depend entirely on whatever hardware you are using for the servo interface.