How can I code two Pi Picos to send/receive data accurately to 10 milliseconds a bit using LED/Photodiode pairs? I am trying to send data from one PiPico to another wirelessly. I am on a bit of a time crunch and have unsuccessfully tried getting my photodiode circuit to output the correct voltage swings to use pico’s UART pins. There
Tag: micropython
Does @staticmethod save any ram in CPython or Micropython?
When answering a recent question I repeated my assumption that one reason for using @staticmethod was to save ram, since a static method was only ever instantised once. This assertion can be found fairly easily online, (e.g. here) and I don’t know where I first encountered it. My reasoning was based on two assumptions, one false: a. that python instantised
MicroPython count button clicks after 5 presses
I’m trying to count button click but only after 5 clicks and after the fifth click it will print the clicks BUT starting at 1. I have the function below and when button_clicks() is called it displays and counts a 6,7,8 etc. instead 1,2,3 etc. I also needed to add another two buttons B3 and B4 that would decrease or
Two-Button Menu Iteration
I’ve got a script that I’m adapting to micropython on a 2040, and I want to use two buttons to navigate the menu structure. I can’t figure out how to make the iterate loop in the multi-choice menus work right… here’s what I’ve got so far: In particular, this is the logic I’m wrangling with: Here’s what I’m wanting to
Can you import python libaries into microPython? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question I have started a project and to test if it works, I used a Pi zero. It has buttons and then sends MIDI Messages to
Why does Micropython ‘const’ not accept float values?
Most Micropython ports contain a ‘micropython’ module, which has a specific function called ‘const()’. I am led to believe it behaves a lot like ‘#define’ in C, however, it only accepts integers. Does anyone know why this is? You can declare float constants in C, so why is this unavailable in micropython? I want to efficiently store values which are
Connecting to Wifi in micro python hangs
I’m trying to setup a function that interactively gets takes user input and connects to WiFi. I can scan the nearby networks and get a list of SSIDs but once I go to actually connect the program always hangs. I can’t seem to figure out why. hardware: LOLIN D32 (esp32 based board) this is the only code on the board