Tommaso Martorellasilvia11931
Published © GPL3+

Read and Write on Serial Port with Zerynth

In this tutorial we'll see how to read and write on a serial port using Zerynth.

BeginnerFull instructions provided1 hour780
Read and Write on Serial Port with Zerynth

Things used in this project

Hardware components

SparkFun ESP32 Thing
SparkFun ESP32 Thing
×1

Software apps and online services

Zerynth Studio
Zerynth Studio

Story

Read more

Schematics

sparkfun

Sparkfun ESP32 Thing

Code

main.py

Python
################################################################################
# Serial Port Basics
#
# Created by Zerynth Team 2015 CC
# Authors: G. Baldi, D. Mazzei
################################################################################

import streams
# creates a serial port and name it "s"
s=streams.serial()

while True:
    print("Write some chars on the serial port and terminate with \\n (new line)")
    line=s.readline() # read and return any single character available on the serial port until a \n is found
    print("You wrote:", line)
    print()
    sleep (300)

Credits

Tommaso Martorella

Tommaso Martorella

8 projects • 4 followers
silvia11931

silvia11931

10 projects • 9 followers

Comments