0

New to programable electronics and wondering if this is poss
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

New to programable electronics and wondering if this is poss

by kiaarra on Mon Jul 29, 2019 2:56 pm

I am making a costume prop and want to be able to light it up in different colours, but I DO NOT want it to blink, or flash, or rotate through the colours, I want it to change colour on demand with the push of a button or switch. I've been reading up on this a lot and have not found any information on how to do this, or if it is even possible. (I am sure this is possible because I have seen those pen lights and drink ice cubes that do it, I'm just not sure if if the right products exist to make this possible for my prop)
The other difficulty I have is that the prop is 1" clear tube with only a 3/4" opening, so I am also limited by size for controller and power supply. (the GEMMA M0 could possibly fit on the outside of the prop if I re-create the handles to accommodate it)
Any information anyone could give me on this subject would be appreciated.

kiaarra
 
Posts: 3
Joined: Mon Jul 29, 2019 2:36 pm

Re: New to programable electronics and wondering if this is

by adafruit_support_mike on Mon Jul 29, 2019 3:17 pm

Yeah, that’s possible.

You can use NeoPixels, which have built-in LEDs and color control, or you can control an RGB LED’s pins directly. Blinking, flashing, ling, and so on are all just extended forms of ‘making the color change’.. you do several changes at timed intervals.

If you don’t want that, the job in easier: you just do one change when the input says you want it.

I’d suggest using the Trinket M0 i stead of a Gemma M0 because it has more pins to handle input. You might need them.

There’s still a design issue to consider though: do you want the colors to change in a specific pattern, or do you want to be able to change from any color to any other? The latter takes more inputs and more work.

adafruit_support_mike
 
Posts: 58799
Joined: Thu Feb 11, 2010 2:51 pm

Re: New to programable electronics and wondering if this is

by kiaarra on Mon Jul 29, 2019 3:27 pm

I don't really care the order the colour changes in, I just want it to be able to be one solid colour as long as I want it to be. If it starts blue, and I have to switch through red and yellow to get to green that doesn't bother me, I just want to be in control of when the colour changes, not have it pre-programmed. (Being able to chose which colour it turns to would be neat, but not necessary, and probably beyond my current skill level)
Trinket would be my preference due to it's size, but i'm not sure if what I am trying to do requires more programming space.

kiaarra
 
Posts: 3
Joined: Mon Jul 29, 2019 2:36 pm

Re: New to programable electronics and wondering if this is

by adafruit_support_mike on Tue Jul 30, 2019 12:45 pm

In that case you’ll only need one button for input, and the code will be simple: if the button was pressed, advance to the next color.

The Trinket M0 has more than enough space for the code. It has significantly more RAM and Flash memory than the Arduino Uno.

adafruit_support_mike
 
Posts: 58799
Joined: Thu Feb 11, 2010 2:51 pm

Re: New to programable electronics and wondering if this is

by kiaarra on Tue Jul 30, 2019 3:51 pm

Thanks! I've put in an order for some momentary push-buttons, Neopixel RGB LEDs and trinket from a local retailer (they only carry 3.3V logic, hopefully that still works, I'm on a bit of a time budget). Do you think you can link me to any tutorials or guides on how to program and wire the controller for this program to work?

kiaarra
 
Posts: 3
Joined: Mon Jul 29, 2019 2:36 pm

Re: New to programable electronics and wondering if this is

by adafruit_support_mike on Wed Jul 31, 2019 12:35 pm

You can start with these:

https://learn.adafruit.com/category/led-pixels
https://learn.adafruit.com/search?q=tri ... 20neopixel

The basic ideas are the same for pretty much any microcontroller though. The information in our Learn Arduino series of tutorials will carry over with only slight modifications:

https://learn.adafruit.com/category/learn-arduino

adafruit_support_mike
 
Posts: 58799
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.