Hi guys, i’m merrily pickling my brain getting to grips with arduino and fastled (which makes a lot more sense to me being a complete n00b). I’m aiming to install 2 neopixel strips as lighting in my VW van (around 350 in total), gathering 10 or so different ‘effects’ to use and being able to alter hue, brightness and speed where applicable, that’s what i’ve been getting to grips with recently, implementing snippets of your code and examples into other bits and pieces with success. There’s a couple of bits i’m struggling with, firstly, how do i go about setting a pot (well, 3) to alter the RGB channels individually…I’d like to light the strips then have control over the brightness and each colour, ultimately that would be default and most used setting i’d have thought. Secondly, how would I go about switching or cycling through the different effects in the program, there’s a little bit of discussion in the xmas lights post. I initially thought of a simple button that when pressed would move onto the next loop, didn’t have much success with that. I saw a video on youtube where a guy cycles effects using a potentiometer, which I mistook for a rotary encoder & ordered. Could the encoder be used, or is it too complicated for the job its doing? Am I right in thinking it could be wired as a digital switch? I’m not fussed about what position its in.
Apologies for the waffle, Nik…
Arduino UNO (Yun for the final install)
It sounds like you could benefit from a couple of months of Youtube’ing and Google’ing for Arduino projects. As I started to learn, I benefited from the trial and error of experimentation. A very helpful resource to assist in learning, is to look at code that works and functions as expected. Funkboxing would send you on a good path of knowledge, if you just Google it.
Another cool feature about this page, is that under the picture for the community, there’s a search bar. This is where you can type in stuff like, “menu” “rotary encoder” etc. and you can see what others have already posted here. I can guarantee that all your questions could be answered by just doing that.
There is a 3.1 branch, I would check that. Especially the DemoReel100 example could be interesting for you, as it contains a couple of nice pattern, including time based automatic swichting between them.
Nick, I am in a similar place. I am doing a project for my end of course submission an college (even though I am 50). I am looking at control via button and potentiometer too. If I find anything useful, i’ll let you know.
As Jon said. The Funkboxing stuff is a good place to start understanding the basic structure of animations. But the timing is all delay controlled there. For a static single effect this is fine but in the moment you want to read buttons in realtime and change parameters it doesn´t work anymore. For that you need a time controlled structure. So http://arduino.cc/en/Tutorial/BlinkWithoutDelay is really your friend.
For reading the pots check http://arduino.cc/en/pmwiki.php?n=Reference/AnalogRead
Rotary encoders: https://www.pjrc.com/teensy/td_libs_Encoder.html (but this is not trivial, maybe just start with a button or a pot for program select)
A general advice for the beginning: Divide et impera! Split your project into as many little problems as possible and then solve them one by one.
Thanks for positive advice Stefan, I’ll look at those this morning. I’m relatively happy with adjusting the spd, hue & brightness…I couldn’t write a program unprompted off the top of my head, but I’m understanding how the simple stuff works looking through the code.
As with most things, the install is time critical. That said, I’m not looking for someone to do it for me, i’m enjoying the process of figuring out…I just wonder if I’ve bitten off more than I can chew when I look at some of the code…lol
If needs be, I can fit with just an ‘all on’ program installed initially, controlling brightness & hue…no better than the RGB strips I have in at present, but using the Yun, it will be relatively simple to update the controller as my knowledge improves.
I set up an array of leds for lighting over the dining table in our travel trailer that has some of the features you are looking to set up. It is using three potentiometers and a mode selector switch. Fell free to use any or all of it as a base to work from. All I ask is credit in the comments and would love to see the results.
The code is here: https://github.com/brencerddwr/color_light_strip
Cheers Richard! I’ll have a nosey through your code tomorrow…well, later today…lol
I’m actually making ok progress, figured out the RGB control, mapping R, G & B to each pot’, was really chuffed with myself and discovered I actually prefer using the H, S, V values instead as it’s much easier to dial in the desired colour and brightness, or vibrance. I’ve only managed some reading so far on the button thing, I think my major faux par was not including a button library? I’d still like to use the rotary encoder, but I think that’s some learning away…I’ll be happy with the button for now
Let me guess: with the button you ran into the problem of contact bouncing. It behaves like pressing the button 3 or 5 or 20 times in a row for no obvious reason? Debounce the input! http://playground.arduino.cc/Code/Bounce
Thanks, I’ll have a look. IIRC, I only managed to get the button to do anything within 1 loop & would pause the loop whilst the button was pressed and resumed on release…I was using ‘if & when’ i think…was some time since I was in button mode…lol
I am using a single pole double throw switch. If it is bouncing, it is not noticeable.
A switch is a different thing. A button usually triggers the change of something - so the question is “how often was it pressed”. Without debouncing that is impossible to say. A switch bounces too, but there it doesn´t matter because it has a stable end position and is usually read often enough so that the bouncing has no significant effect on the result.