My Technology Trail avatar

Teaching myself Python Day 11

mytechtrail

Published: 20 Dec 2019 › Updated: 20 Dec 2019Teaching myself Python Day 11

Teaching myself Python Day 11

pythonpowered.png

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:

pylearn-day11.png

Leave Teaching myself Python Day 11 to:

Written by

Projects I am working on, Raspberry Pi, Python and Ham Radio.

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.

More Posts From My Technology Trail