Questions tagged [micropython]

MicroPython is a Python interpreter (with partial native code compilation feature). It provides a subset of Python 3.5 features, implemented for embedded processors and constrained systems.

About

MicroPython is a lean and fast implementation of the Python 3 programming language that is optimised to run on a microcontroller. It was originally created by the Australian programmer and physicist Damien George and first appeared in May of 2014.

The MicroPython board is a small electronic circuit board that runs MicroPython on the bare metal, and gives you a low-level Python operating system that can be used to control all kinds of electronic projects.

MicroPython was successfully funded via a Kickstarter campaign. The software is available to the public under the MIT open source license.

Books

Sites

Damien George's KickStarter project to develop a API to use with ESP8266 WiFi chip, optimised and well supported. ESP8266 is one of the best boards to use with MicroPython.

Example projects

1031 questions
2
votes
1 answer

BBC Micro Bit Hanging on code

I'm trying to read a file containing instructions for a turtle robot in micropython on the BBC micro bit but when I flash my code and add the correct files it just hangs and doesn't seem to do anything. It runs fine in python on my machine. Is…
CapnMarcy
  • 31
  • 2
2
votes
2 answers

Micropython HC-SR04 - ESP8266

I am trying to get the NodeMCU ESP8266 dev board to work with an HC SR04 Ultrasonic Sensor. I keep getting a reading of "0", which is not the reality. I have the ground and 5v pins of the sensor hooked up to a 5v source, and the Echo and Trigger…
LukeVenter
  • 439
  • 6
  • 20
1
vote
0 answers

Want connect Bluetooth esp32 to IOS

i just want connect esp32 bluetooth to IOS this code can connect with android only I got this code from this Github and i use two code i used ble_advertising.py and…
TaHaRock
  • 11
  • 2
1
vote
1 answer

OutOfMemory in MicroPython

I use MicroPython on my Raspberry Pi Pico and try to display a BLOB coming from an HTTP API on a Waveshare ePaper display. This is my code: epd = EPD_7in5_B() epd.Clear() while(True): response =…
mu88
  • 4,156
  • 1
  • 23
  • 47
1
vote
0 answers

"Access denied" in python serial library

Hello I am new at coding the microcontrolers and I dont know what I am doing wrong. Could someone help me. I get the access denied. I checked everything the port, baudrate, drivers and still get this error. I dont have more ideas CODE IN…
ROM3K
  • 15
  • 3
1
vote
1 answer

Ampy - ModuleNotFoundError: No module named 'progress_bar'

I tried installing https://github.com/scientifichackers/ampy from source. I'm running Ubuntu 23.04 and Python 3.11.2. I ran this command in the source folder: sudo python3 setup.py install The installation completed successfully. Now I get the…
mongoq
  • 11
  • 2
1
vote
1 answer

wlan.scan() returning empty list & cant connect to network micropython

I'm trying to create a sever with my raspberry pi pico w, but for some reason I'm not able to connect to the network. That is, after calling wlan.connect(), no matter how long I wait, it doesn't connect. I've been following this tutorial to a T, so…
Drago627
  • 11
  • 2
1
vote
2 answers

How do I fill a 3d array with 0's without Numpy

I am using a 3d array to control a RGB Led matrix via a micro controller using MicroPython. I can't use Numpy to make the array. But it needs to be filled in order for the rest of the code to call on versus positions. It would be nice if it can be…
Macwa
  • 13
  • 4
1
vote
0 answers

Estimating displacement from double integral of acceleration samples

I have acceleration samples from an inertial measurement unit in m/s2. I also have a gravity vector orthogonal to earth. I want to calculate the approximate displacement range (swell/bobbing height). Is my approach right? First I take the dot…
Jason Kleban
  • 20,024
  • 18
  • 75
  • 125
1
vote
1 answer

Streaming mp3 audio from a URL in circuitPython

I want to stream mp3 audio from a URL using the Raspberry Pi Pico W. This is my code: import adafruit_requests import wifi import socketpool import ssl import board import audiomp3 import audiobusio import os audio = audiobusio.I2SOut(board.GP10,…
1
vote
1 answer

how to turn raw audio output from analog microphone into mp3 file?

I am working with a RPI Pico w, I have an analog microphone connected correctly and outputting raw audio data, how do I convert it into a file I can listen to?? I am using the micro python language.
SweetWhite
  • 61
  • 7
1
vote
0 answers

Reading sensor data from UART ESP32 on Windows 10

I am currently trying to get data from a sensor which is connected to the UART ports (GPIO 16 and GPIO 17) of ESP32. I've googled on how to do that but I did not found a proper tutorial on how to do that. I am using Micropython. ESP32 Pinout I know…
Alex
  • 11
  • 3
1
vote
0 answers

How To Consume an API From a Nodemcu (ESP8266 WiFi Module)

I have configured a Kubernetes kind cluster to run a flask API. The flask App when run locally with flask run produces an IP which is the local machine assigned IP from the local network (192.168.100.19). My Nodemcu which also has an IP of…
sam hassan
  • 197
  • 3
  • 14
1
vote
0 answers

micropython warnings: "initialization discards 'const' qualifier from pointer target type"

I am working on a C module for micropython. It compiles fine, but I get a lot of warnings and I would like to know what I am doing wrong. I have tried to work according to this tutorial. But I am getting warnings when I compile. Is there any way to…
Sabsa
  • 191
  • 9
1
vote
1 answer

How to dynamically assign variable into #define statement in header file

I have EXTREMELY limited programming experience but am working on a custom Micropython build. A feature is enabled/disabled using a #define statement in a C header file e.g. #define MICROPY_HW_USB_MSC (1); I would like to make this dynamic as part…
DoubleVee
  • 11
  • 2