Search found 3 matches

by hsmptg
Fri Nov 29, 2019 9:07 pm
Forum: General Discussion and Questions
Topic: MicroPythonic way to non-blocking read a character from the serial USB port
Replies: 7
Views: 608

Re: MicroPythonic way to non-blocking read a character from the serial USB port

Before posting, I tried that code on an ESP32 board with the actual firmware. You may have to update the firmware. I am using: MicroPython v1.11-611-g7f24c2977-dirty on 2019-11-29; ESP32 module (spiram) with ESP32 Detaching UART 0 does not seem to work like it is for the ESP8266. Well in fact I was...
by hsmptg
Fri Nov 29, 2019 6:54 pm
Forum: General Discussion and Questions
Topic: MicroPythonic way to non-blocking read a character from the serial USB port
Replies: 7
Views: 608

Re: MicroPythonic way to non-blocking read a character from the serial USB port

There is still a simple function missing, which tells, whether and how many characters are available at sys.stdin. You can however use uselect.select() with a short timeout, e.g. import uselect import sys list = uselect.select([sys.stdin], [], [], 0.01) if list[0]: byte = sys.stdin.read(1) else: by...
by hsmptg
Fri Nov 29, 2019 12:24 pm
Forum: General Discussion and Questions
Topic: MicroPythonic way to non-blocking read a character from the serial USB port
Replies: 7
Views: 608

MicroPythonic way to non-blocking read a character from the serial USB port

I would like to read the characters received through the serial USB connection of an ESP32-Pico-Kit board inside my main.py. I already used the sys.stdin.read(1) to read a single character but it halts the program execution while the user do not send that character. It is possible to do something si...