In a simple project i need the Pico, attached via USB to the PC, to receive a string, calculate an hash, and send back the result to PC.
On the PC i wrote the Python script that sends the string via serial.write to /dev/ttyACM0
On the Pico what is best way to wait for data and send back result with circuitpython?
I tried:
Code: Select all
import sys
string = sys.stdin.buffer.read()
Code: Select all
AttributeError: 'FileIO' object has no attribute 'buffer'
but for output to PC? should i just use print() or again something like: sys.stdout.write()
the script on PC is using serial.readline() to retrieve result.
Thanks in advance for any suggestions!