Showing posts with label Micro:Bit. Show all posts
Showing posts with label Micro:Bit. Show all posts

Sunday, March 7, 2021

ampy - Utility to interact with a MicroPython board over a serial connection.

 

This can be really useful to control the I/O hardware if your control board is running on MicroPython like the Micro:Bit. 


I found ampy was being used by the Hadabot Project used for teaching ROS2. that consisted of an ESP32 Wifi board running ampy, and a simple DC motor controller on a magic chassis , turtle bot robot that is just two motors, a motor driver , and encoders, and a few sensors.  Everything was being over Wifi to be controlled by ROS via the ampy python library which is a cinch to in then map ROS messages in to micropython function calls.  


https://github.com/scientifichackers/ampy

ampy

MicroPython Tool (ampy) - Utility to interact with a CircuitPython or MicroPython board over a serial connection.

Ampy is meant to be a simple command line tool to manipulate files and run code on a CircuitPython or MicroPython board over its serial connection. With ampy you can send files from your computer to the board's file system, download files from a board to your computer, and even send a Python script to a board to be executed.

Note that ampy by design is meant to be simple and does not support advanced interaction like a shell or terminal to send input to a board. Check out other MicroPython tools like rshell or mpfshell for more advanced interaction with boards.

Sunday, September 2, 2018

Micro:bit limits of tone generation

I played a sliding tone, but found because of the clock divider logic that as the frequency went up the resolution of the output frequencies turns into steps.

Here is the output of an iPad spectrum analyzer on a program that just increments frequency by 10 hz up to 30khz to see if I could use the microbit for ultrasonic communications.

The multiple lines come from the fact that its outputting square waves that have odd harmonics.