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:
Leave Teaching myself Python Day 11 to:
Read more #hive-142614 posts
Best Posts From My Technology Trail
We have not curated any of mytechtrail's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.