Back to Mejdi_FabAcademy_FollowUp
Week14: Interface and application programming
Assignment:
- write an application that interfaces with an input &/or output device that you made
- compare as many tool options as possible
Part of my final project.
As a scientist/engineer I mostly use Python (with the spyder IDE of Anaconda).
My goal for this assignement is to writte a Python script that:
- Monitors a serial USB (coming from a MCU)
- Send instruction through serial USB?
- Do "real time" plot of the serial data
I'll use the PYserial library for the serial com,
following this exemple.
I am on Windows 10 and I use Spyder through the Anaconda package. To install PYserial , i write conda install pyserial in the Anaconda consol (open with administrator right):
For the data management & display i'll use the numpy and matplotlib libraries.
An interesting discussion here
on how-best-to-do real time ploting with those tools.
My MCU pcb runs this code.
It measures my sensor PCB with I2C and print the temperatures through USB Serial:
My Python script:
- reads the serial
- extract the temperature and time from the char line
- save it in a numpy array
- plot it live in a figure
Back to Mejdi_FabAcademy_FollowUp