BrainPad Micropython examples updated

I’ve updated hendra’s Micropython examples to include all the inputs and outputs of the BrainPad Classic/BP2 board. There are now examples for sound, temperature and RGB LED.

scruss /
brainpad-micropython

It’s a really nice platform to work with.

1 Like

Not sure if my head is wrapped around this right?

Are you saying that it is possible to download a microPython (mp) script file, like any file to tinyCLR, and execute this script inside applications?

Essentially what I am asking, if one downloads something like a configuration file (.txt, .csv…whatever), this mp script could be parsed and the result executed upon?

More clarification:
If an IO point requires additional processing, mp would be able to provide?

I don’t think tinyCLR is involved. MicroPython runs directly on the BrainPad BP2’s STM32F401RE, and is loaded in DFU mode. With the current board definition compiled in, about 35 K of flash appears as a very tiny USB drive for your programs. You can either have the board auto-run them (first boot.py, then main.py), invoke them from the serial REPL, or use a tool like pyboard.py to manipulate them from the host computer.

Gus was all about MicroPython running on the BrainPad a few years back: Running MicroPython on the BrainPad - TechTalk 045 but has been otherwise occupied. No biggie; MicroPython’s got a big enough community that new board support comes out all the time. All the hardware on the BrainPad Classic/BP2 is supported by existing MicroPython libraries and methods. It’s really just a matter of trial and error with the schematic and chip manual to find out what needs done.

It would have been lovely to write a wrapper library that puts all of the BrainPad’s functions into one tidy MicroPython object like the one for the BBC micro:bit. Maybe later.

MicroPython (and its for-beginners and for-making-Adafruit-$$$ fork, CircuitPython) runs on lots of hardware, as long as it has ≥ 256 K of Flash and ≥ 32 K RAM. It’ll run on a tiny Cortex-M0 ATSAMD21E18, the cheap and wifi-enabled ESP8266 and the utterly monstrous Cortex-M7 processors, as well as on generic Linux systems. The original pyboards, sale of which supports the core developers, run STM32F4s of similar spec to the ones GHI uses.

(Just before the forum moved, I posted my design for a 3D printed BrainPad Classic case. It’s been keeping the USB cable safe and the board fritz-free on my perilous desk for the last few months. It’s all in the best possible taste:
brainpad1-smol )