MicroPython_ESP32_psRAM_LoBo
MicroPython_ESP32_psRAM_LoBo copied to clipboard
How to send bytes back and forth over USB?
This is trivial on Arduino -- just call Serial.read and Serial.write. Isn't there anything comparable here?
I want to plug my m5stack into a computer and run a command line tool (PySerial) which can send bytes to the m5stack and receive bytes from the m5stack.
The UART to USB converter is attached to UART0 -- so I'd like to use this. But it's disabled.
I tried machine.stdin_get and machine.stdin_put but these seemed very clunky and interfered with debugging.
What's the best way to accomplish this?
print () and input ()
You may need to use thread for input() as it is blocking until you type something in . Also take a look at dupterm()