r/MicroPythonDev • • Dec 12 '25

Touchscreen example code

4 Upvotes

I'm new to micropython; but I have several years of significant Python programming under my belt. I've always focused on back end, and middleware. So I dont do anything with front ends; except for interacting with pre-baked ones.

I have a simple project in mind, and I think micropython is perfect for it. Its simply a timer, and sensor reader, that activates one of a couple of relays. Most important though, I want it to have a touch screen. I picked up a Waveshare 3.5"(f), and a pico 2 w. I was able to get the waveshare demo for pico working; even though they dont give a direct pinout. I had to read the script, and figure out what each one was for. But I did get that working. Screen lights up, and touchpad is reading out correctly.

So the next thing is building a simple touchpad interface. Does anyone have any example code for this? Coincidently the day I got the pico, 1.27.0 was released. So I'm obviously planning to use that version of micropython.

Also, I was able to get it connected to wifi. So I've got hands around the physical hardware, and basic interpreter functionality.


r/MicroPythonDev • • Feb 20 '25

Raspberry pi pico W API project

4 Upvotes

TD;DR - I made a useful wifi-based API to wireleslly control the GPIO of the board: https://github.com/christierson/APICOW

Hi!
I have been working on a couple of projects using the raspberry pi pico W and I got annoyed by the development/testing process where it requires you to upload changes to the code if you want to change the GPIO.

So yeah, this project solves that problem. Instructions on how to use it are in the README, but in short, once it's installed, you'll be able to configure the GPIO of your board over a wifi connection using a Python REPL interface.

It's pretty basic at the moment, and you need to be familiar with MicroPython to properly use it. But I figured that this project will save a lot of time for a lot of you guys either way, especially if you can't be asked to deal with wifi communication yourself.

I really want to further develop this project, but I don't have too much time to dedicate to this so contributions are more than welcome. I would love to see this project grow.


r/MicroPythonDev • • Jan 24 '25

How to install MicroPython on ESP32

4 Upvotes

Hi fellow hackers, I wrote a tutorial on 2 different ways (GUI and CLI) of installing MicroPython on an ESP32. Hope it's helpful to those of you who want to try out MicroPython but didn't know how. Feel free to me ask any questions/clarifications here if you'd like :)

https://bhave.sh/micropython-install-esp32/


r/MicroPythonDev • • Nov 29 '24

Do any of you use VSC instead of Thonny etc?

4 Upvotes

public slim instinctive reminiscent dime spoon aback plough mountainous meeting

This post was mass deleted and anonymized with Redact


r/MicroPythonDev • • Oct 14 '24

Monitoring noise levels with MicroPython

4 Upvotes

I built a sound level meter and IoT noise monitoring device. It can measure standard acoustical metrics for noise, and transmit them to an IoT dashboard. Code and instructions can be found here: https://github.com/emlearn/emlearn-micropython/tree/master/examples/soundlevel_iir

* For audio input, it uses an I2S digital microphone via the machine.I2S module.
* Running on ESP32
* For processing audio efficiently, this uses emlearn-micropython, a Machine Learning and Digital Signal Processing package for MicroPython: https://github.com/emlearn/emlearn-micropython
* For the IoT dashboard, it uses https://blynk.io/

General discussion thread about emlearn - follow for related news: https://github.com/orgs/micropython/discussions/16004


r/MicroPythonDev • • Jun 30 '24

ViperIDE - An Innovative MicroPython IDE for Web and Mobile

Thumbnail viper-ide.org
4 Upvotes

r/MicroPythonDev • • Apr 10 '24

Circuitpython Brainbuster for the μPython Crowd

Thumbnail
gallery
4 Upvotes

I have an Optocoupler connected to my Adafruit Feather ESP32-S2 - 2Mb PSRAM and Stemma QT/Qwiic Adafruit 5000 on a custom PCB where it receives a steady 4.95volts and 0.5 amps. The optocoupler requires power on its 5v pin and a GND(duh) then it has a signal pin which is connected to pin D6 on the feather. I have a single piece of dark material that blocks the signal from the Optocoupler as the entire PCB spins.

I use analogio to set a variable as an analog input for the D6 pin. With board.D6 in the usual way. The code is working as it perfectly reads the value 50976 when the Optocoupler does not have the dark material in its path; the .value reads the pin at around 4000 or so when it is blocked by the dark material.

The problem is that when I rotate the sensor fast it doesn’t even detect a change in the 50976 analog read. When I rotate it really slow with my hand, it will detect the drop in the analog value. Though it’s nowhere near the speed at which I will have this sensor moving when the motor is on.

I even tried appending an array with the .value method where I fill an array of 250 or so values and that entire array is the same 50975 value when I rotate it fast. Which makes no sense at all. I even tried making the array sample size at like 2000, and had a start time.monotonic() and stop.monotonic() where the array was filled in a ridiculously short amount of time. More than enough time to actually detect a signal drop at even a super slow hand spun speed of like 3 rotations per second.

I even tried bit shifting the analog output to 32 bit and that number still doesn’t even detect the drop in signal. As you can see commented out in the 1st and 2nd photo.

Rotaryio doesn’t work because it needs two sensor values like MOSI and SPI or whatever it requires and measure the two pins; typically for slow potentiometers.

Pulseio has horrible documentation and only references how to use it for remotes.

What I really need to do is use some lower level python syntax code to read the ADC but I can’t find out how to do that anywhere and each attempt to do so gives me errors because nothing is supported in circuitpython.

It the third reference image I have the optocoupler on the right of the photo with the led on showing it’s signal is at 50976 and in the 4th photo the signal is lower at like 4000 or so and the led is off. In the first photo of my ide you can see the array where it’s all populated with the correct readings when the led on the optocoupler is off because the signal is blocked.

In the 5th photo the motor is on and the frame rate of the camera is showing an inaccuracy. With your eyes you see an almost full arc where the led on the optocoupler cuts out exactly with my dark material is. So the led is reacting to the infrared sensor but the code is too slow.

You may say I’m not hand spinning the motor fast enough when the array is being filled. Though when I remove the 5 second time.sleep() and continue to spin the motor it has the same effect so it’s not that.

What should I do? Help!


r/MicroPythonDev • • Dec 28 '23

MicroPython for the ESP32: Our First Programs

Thumbnail
elektormagazine.com
4 Upvotes

r/MicroPythonDev • • Mar 21 '23

Code for raspberry pico

4 Upvotes

This is my first project with raspberry pico. I want to control a servo that moves from position one to position two at any random time between 30 sec to 70 sec. Can anyone please help me with the code?


r/MicroPythonDev • • Jan 17 '23

Is there language support Micropython in VScode?

4 Upvotes

the pico go extensions are great but I get some syntax errors get annoying


r/MicroPythonDev • • Dec 23 '22

pylogix micropython port development

Thumbnail self.plc
4 Upvotes

r/MicroPythonDev • • Sep 16 '22

Requests.posts from a Pico W

4 Upvotes

I am hoping to deploy a Pico W to monitor a door switch for my security system. When the switch opens or closes, I want the Pico to do a requests.post to URLs that sends the corresponding keyword to my phone. Tasker and AutoRemote digest the keywords to give me appropriate notifications and sounds, and other functions.

I have not found an effective way to import/install requests to do this. Is this possible?


r/MicroPythonDev • • Jul 17 '22

First impression on the new Pico W

4 Upvotes

The new Pico W is awesome. I got mine just a few days ago and immediately strated experimenting with it and it was easier and better as I expected.

Mind you there is an issue with Thonny 3 (which can easily be solved) and the internal led has to be adressed in another way.

But Wifi is what I was looking for all the time. And there is great support for it in MicroPython.

Read my first impression here: http://lucstechblog.blogspot.com/2022/07/pico-w-first-look.html


r/MicroPythonDev • • Apr 13 '22

Working with MIT App Inventor on my ESP32 with Bluetooth

4 Upvotes

Hey dear app-Inventors!

So today I spent a whole day trying to work out a Micropython code to work with MIT-App Inventor. There's a basic Micropython-sketch available and it works only with Serial Bluetooth Apps like Serial Bluetooth Terminal or nRF Connect.

So I followed Microchip University's Guide (you have to click on curriculum, navigate to resources and register, but it's really worth it!) to get it working and my success was to scan for BLE Devices, yet I still couldn't connect to my ESP32. I learned that the Classic Bluetooth isn't really supported in Micropython on the ESP32, and the MIT App didn't work at all with classic Bluetooth, when I tried it. All the Micropython tutorials were using the Serial Bluetooth Apps for communication, I also got that working for me. For BLE in the MIT App Inventor, I had to set UUIDs for Service, Receive and Transmit, which I copied out of the Micropython Sketch. I understand that they're needed to address where the data is sent and received. The App from Microchip University which I replicated had me also some questions open, like variables for ble itself. For example I had to set the ble_mac_address, which I understood to type in the MAC-address from the ESP, also I gave the ESP a name, where I had to put in the Name from the code as in ble_name = ESP32BLE (you'll also find that in the uPython-Sketch) but a third variable had to be defined which was ble_address. I don't know exactly what was meant here and the guide doesn't really show as well. Also there was an open part of code in the direct-connection which made not much sense.

If anyone can help me get this working, I'd be so relieved, all I wanted was to connect my ESP via Bluetooth with an App to control a robot car. Should I ditch it all and go for Arduino? I like Micropython so much more :x Arduino takes ages to compile. Also, does Arduino simply make the Classic Bluetooth happen on the ESP?


r/MicroPythonDev • • Apr 03 '22

Why this execute just the first task?

Thumbnail
gallery
4 Upvotes

r/MicroPythonDev • • Sep 17 '21

Tutorial Raspberry Pi Pico: Display animation oled ssd1306 128x64 SPI

Thumbnail
youtube.com
4 Upvotes

r/MicroPythonDev • • Jul 18 '21

Does MicroPython support connection with MongoDB?

4 Upvotes

Im making a proyect where my microcontroller sends data to a mongoDB but i dont know if its possible due to micropython is not as powerfull as Python


r/MicroPythonDev • • May 03 '21

MicroPython Newsletter Issue 11

Thumbnail
forum.micropython.org
4 Upvotes

r/MicroPythonDev • • Feb 28 '21

Pycom boards

Thumbnail docs.pycom.io
4 Upvotes

r/MicroPythonDev • • Feb 28 '21

Programming Raspberry Pi Pico with Python and MicroPython

Thumbnail
raspberrypi.org
4 Upvotes

r/MicroPythonDev • • Feb 28 '21

I love MicroPython

4 Upvotes

I love using python on electronics boards!

First post!


r/MicroPythonDev • • 4d ago

Dual platform MicroPython/full Python driver for the MAX31760 fan speed controller

3 Upvotes

Dual platform Micropython/full Python driver for the MAX31760 fan speed controller. Runs on both MicroPython and full Python on an SBC such as a Raspberry Pi. Fully end-to-end testing on Raspberry Pi Pico W 1, ESP32-S3 and Raspberry Pi 3A+. Tested MicroPython versions: v1.19.0, v1.29.0 (latest available at release time). Full API layer implemented as oulined in MAX31760 datasheet. Every API tested with hardware verification feedback.

https://github.com/mecworks/max31760-fan-speed-controller-python-driver


r/MicroPythonDev • • 12d ago

ICYMI Python on Microcontrollers Newsletter: Adafruit Metro P4 Hydra, Possible New Raspberry Pi Boards, JIT Gone and More!

Post image
3 Upvotes

If you missed this week’s Python on Microcontrollers Newsletter, here is the ICYMI (in case you missed it) version.

To never miss another issue, subscribe now! – You’ll get a terrific newsletter each Monday (which is out before this post). 12,313 subscribers worldwide!

The next newsletter goes out Monday morning and subscribing is the best way to keep up with all things Python for hardware. No ads or spam, no selling lists, leave any time.

Read this week's issue at https://blog.adafruit.com/2026/11/03/the-python-on-microcontrollers-newsletter-adafruit-metro-p4-hydra-possible-new-raspberry-pi-boards-jit-gone-and-more/


r/MicroPythonDev • • 13d ago

The Python on Microcontrollers Newsletter: subscribe for free

Post image
3 Upvotes

The Python for Microcontrollers Newsletter is the place for the latest news involving Python on hardware (microcontrollers AND single board computers like Raspberry Pi).

This ad-free, spam-free weekly email is filled with CircuitPython, MicroPython, and Python information that you may have missed, all in one place!

You get a summary of all the software, events, projects, and the latest hardware worldwide once a week, no ads! You can cancel anytime.

It arrives about 11 am Monday (US Eastern time) with all the week’s happenings.

And please tell your friends, colleagues, students, etc.

Please sign up > > > adafruitdaily.com


r/MicroPythonDev • • Sep 01 '26

light_nmea: A Zero-Allocation NMEA 0183 Parser designed to stop memory fragmentation

3 Upvotes

Hi everyone,

If you've ever built a GNSS/GPS tracker using micropyGPS on a high-rate (5–10 Hz) Multi-GNSS module, you know the pain. Standard parsers heavily spam the heap with short-lived string allocations on every incoming sentence. This triggers the Garbage Collector constantly, introduces unpredictable latency, and leads to memory fragmentation on long-running deployments.

I built light_nmea to solve this once. It’s a pure MicroPython NMEA 0183 parser written with a hardware/systems mindset.

Why it's different:

  • Zero-Allocation: It processes data in a single pass without dynamically allocating objects on the heap inside the main loop. No GC spikes.

  • 15x-20x Faster: Benchmarks show up to 15x faster execution compared to standard MicroPython alternatives.

  • Modern GNSS Ready: Fully supports multi-constellation Talker IDs ($GN...).

  • Lightweight: No external dependencies. Just a clean, drop-in folder for your ESP32, RP2040, or STM32 projects.

Check out the code, run some benchmarks on your hardware, and let me know what you think!

GitHub: https://github.com/octaprog7/light-nmea-micropython