Micropython Display To Pc Screen
Micropython Display To Pc Screen
Hi All,
I am a intermediate python programmer who wants to start using micropython. I was wondering if their is a module or method that would allow me to display a gui (on my computer screen) that interacts with the pyboard or a similar microcontroller via the usb port. Something similar to Tkinter and Pyside.
I am a intermediate python programmer who wants to start using micropython. I was wondering if their is a module or method that would allow me to display a gui (on my computer screen) that interacts with the pyboard or a similar microcontroller via the usb port. Something similar to Tkinter and Pyside.
Re: Micropython Display To Pc Screen
I do not believe a method or module exists for this in the MicroPython codebase. There could be other 3rd party modules for this, but if I were you I would just set up a python serial port listener, dump a framebuffer over UART to the PC, and use pygame to render it onscreen. I don't have any code for this, but I'm planning on writing a module (using WebREPL or equivalent) to project the graphics from a tiny OLED onto a PC screen, but not in the foreseeable future.
Re: Micropython Display To Pc Screen
Would I use a cable like this to set up a serial communication between pyboard and the Pc?
https://www.amazon.com/Serial-Adapter-S ... 150&sr=8-4
https://www.amazon.com/Serial-Adapter-S ... 150&sr=8-4
Re: Micropython Display To Pc Screen
Which Micropython board do you use? Many of these have a USB interface for serial communication. Then you would not need this cable. This cable is only required, if the board has 3.3 level UART only.
Re: Micropython Display To Pc Screen
I am using the pyboard v1.1. It has multiple tx and rx pins for uart communication so I thought I would have to use them
Re: Micropython Display To Pc Screen
You can use them, but the Python REPL prompt is at the USB port.
- wintifrosch
- Posts: 12
- Joined: Sun Mar 20, 2022 9:37 am
- Location: Winterthur, Switzerland
- Contact:
Re: Micropython Display To Pc Screen
@Zcannon78: Try Thonny IDE. Good for starters.
Your idea of using USB is interesting, though.
Not an easy task, it could be a community project, since components using different technologies are required: Based on the USB/REPL interface and Browsers experimental USB-Interface (Chrome + Edge + Opera), a WebPage in your browser could talk to your microcontroller.
In addition, the project could provide libraries to reroute the communication over Ethernet instead of USB/REPL, i.e. for ESP devices.
Your idea of using USB is interesting, though.
Not an easy task, it could be a community project, since components using different technologies are required: Based on the USB/REPL interface and Browsers experimental USB-Interface (Chrome + Edge + Opera), a WebPage in your browser could talk to your microcontroller.
In addition, the project could provide libraries to reroute the communication over Ethernet instead of USB/REPL, i.e. for ESP devices.
Re: Micropython Display To Pc Screen
@Zcannon78 You may want to have a look at upydevice and the examples with pyboard v1.1 and pyqt at https://github.com/Carglglz/upydevice/t ... s/pyqt-gui
Re: Micropython Display To Pc Screen
@cgglzpy I tried out the upydevice library but my experience was inconsistent. I have been able to turn on and off the built-in leds and read the directories once. After I had uploaded different programs to the pyboard, the upydevice program stopped communicating with the pyboard and I had to reset. When I factory reset the pyboard, I tried to read the directory files again and it gave me the error NameError: name 'os' isn't defined. Although I could still turn on and off the leds.
Re: Micropython Display To Pc Screen
Did you by chance upload a file called "boot.py" or "main.py" and put a while loop in it?