Teaching myself Python Day 11
Today's learning consisted of learning how to open a USB serial port to read a serial data stream from a wireless module which receives temperature readings from remote wireless sensors.
This code is running on a Raspberry Pi and will eventually write the temperature readings to a MySQL database.
Next steps will include pulling the correct data from each data stream.
Here is the code from today's learning:
import serial
ser = serial.Serial('/dev/ttyUSB0',115200)
wloop = True
while wloop:
x = ser.readline()
print(x.decode('UTF-8'))
And here is a screen capture of the output from the program:
0
0
0.000
0 comments