Presto with IOExpander PIN_OUt to LED

Hi Members,
I just published a new repo

Purpose: controlling a 3-in-1 LED or 3 separate LEDs from a MicroPython script running on a Pimoroni Presto. Control of the LEDs via I2C to a Pimoroni Breakout Garden IOExpander (PIM 517) on a Pimoroni Breakout Garden Adapter (PIM 571).

1 Like

Dear Paulsk,

You are the missing link I’ve been looking for!

I truly appreciate the Presto format and am currently exploring its capabilities for a project called PrOLeT… (Presto Online Learning Tool No. xyz)—designed for both self-paced and guided learning.

In this context, having an option for acoustic feedback—e.g., flexible tone generation via PWM or MP3 output—would be extremely valuable.

Do you see any possibility to use or adapt your IOExpander model for this purpose?

Any advice or suggestions would be greatly appreciated.

Many thanks in advance!

Hi DieterCarbon,
Thank you for your nice response.
To make a long story short: yes, I think it will be possible to create a kind of acoustic feedback using the Presto. How to do? I don’t know yet. I am going to investigate and try in the coming week or so.

I started this project because my intention was to create an alternative for the weak buzzer signals the Presto has. This first project using a Pimoroni Breakout Garden IOExpander in combo with a Pimoroni Presto is my first attempt to do such thing with a Presto. My intention was also to send tones and/or music (could be MP3) via the IOExpander to a Pimoroni Pirate Audio with Lineout (PIM 483) that I just have in the house. A better option, I think, would be the Pirate Audio 3W stereo output (PIM484). There is a nice article (the link I found on Pimoroni’s webpage for the PIM484). Unfortunately this and the Pirate Audio Speaker (1W) (PIM485) are sold out.

The problem I encountered to interface the PIM483, using the Breakout Garden IOExpander and the Breakout Garden ADAPTER, is that Pimoroni has a lot of libraries for the Breakout Garden hardware however the “pieces” that I needed were, AFAIK, not for MicroPython or called libraries like in the original rgbled.py, which started with an import of the colorsys module, which on its part called for a strain of C-libraries. So, in rgbled.py, i kicked out the all references to the colorsys module.

So, my next step will be to try go get audio into the PIM483. The LINE OUT I will connect to an audio system with a 3-channel audio mixer that I use for my computers.

By the way: the IOExpander pins 1, 3 and 5 that I am using in this repo to drive the LEDs are PWM pins. I don’t know if you already saw the question/discussion from @Tonygo2 PRESTO with IO Expander - PWM and ADC advice. However this is also about driving LEDs as far as I read. and understand it.

The (little) problem I faced was that the libraries for older examples to use the Breakout Garden group of devices use a bit of different names for certain class methods. The nice thing is that the firmware for the Presto already has built-in modules like:

from pimoroni_i2c import PimoroniI2C
from breakout_ioexpander import BreakoutIOExpander

I already created an alternative by sending a “command” in the form of an impulse to a M5Stack M5Echo (speaker) device which on its turn produced beep tones, however this I did not publish (yet). For the M5Echo I wrote a sketch in Arduino C++.

Regards,
Paulsk