What's the best way to add buttons to Plasma 2040

Hi!!

We are go!! I’ve got the plasma 2040 up and running and systems are firing on all cylinders.

My next step is attaching more buttons - at least 12. Can anyone recommend the best QW/ST module to attach more switches to a Plasma2040? Or if a QW/ST is not right, then another way of getting 12 buttons on here?

Thanks!

You should be able to use the SDA, SCL, INT pins as GPIO for buttons. As well as A0, A1, A2 and maybe the SWC ,SWD?
Then add button combo’s, If 1 and 2 pressed do this

Just saw this, Adafruit LED Arcade Button 1x4 - STEMMA QT I2C Breakout [STEMMA QT / Qwiic] : ID 5296 : $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits
Changeable address so you can use more than one etc. Circuit Python and Python libraries.

Not bad!!

I am going to try a multiplexer which has 16 channels ⭐️ I’ll let you know how it goes

If anyone from the future is reading this, I have not yet tested this, but I believe the easiest thing is the IOexpander, made by Pimoroni themselves.

It will be a week or so before I check this out, I will update this thread.

Josh

Just wanted to share some videos of what I ended up making. It’s a plasma 2040 with an Io expander controlling 5m of LEDs.

Joshy J shared a post on Instagram: "Finally the attention I so desperately crave 🎉🎉🎉
.
Check out my home-made lighting rig at a party near you soon ✌️✌️". Follow their account to see 461 posts.

Joshy J shared a post on Instagram: "chill.
#LED artist & maker working in Bilbao". Follow their account to see 461 posts.

https://www.instagram.com/p/CdEHZwXqRvS/?igshid=YmMyMTA2M2Y=

1 Like

That looks ace, I love it!

Just trying to post video…

Really proud of my experience with pimoroni. First bought from them in December 2021. This year I’ve done around 10 parties with my own lights and got paid to design/program lights for others.

1 Like

As well as A0, A1, A2 and maybe the SWC ,SWD?

Hi!

I’m back. How would I go about checking if A1 is connected to ground in micropython? I’m sorry as I know this is a very basic question, but I am not sure even where to start here. Please can someone tell me which micropython library to use and what the code might look like, or tell me where I can find that information.

Thanks.

One way to do it is to use Pimoroni’s button library.
On my Tufty it goes like this.
Keep in mind on the Tufty the buttons are wired to 3.3v
If wired to ground its likely
button_a = Button(7, invert=True)
or just
button_a = Button(7)

from pimoroni import Button
button_a = Button(7, invert=False)
button_b = Button(8, invert=False)
button_c = Button(9, invert=False)
button_up = Button(22, invert=False)
button_down = Button(6, invert=False)
button_boot = Button(23, invert=True)

Just change the numbers to match what GPIO pins you use.
Then to test them do the following.

     if button_a.is_pressed:
        print ("Button A pressed")
        utime.sleep(0.2)

Perfect! Thank you so much. I will try this as soon as I can.

Near as I can tell, the numbers are the GPIO number, not the physical pin number.
So A1 is GPIO26, button_A1 = Button(26), if button_A1...etc

Just found this, might be worth a look.
pimoroni-pico/rgb-led-and-buttons.py at main · pimoroni/pimoroni-pico · GitHub

Very useful. I will check that library and try all the numbers.

Thanks