cant seem to get this simple program to work… would any one of you guys mind looking over it to see whats wrong with it?
main loop - http://pastebin.com/QPhRWUCj
Buttons - http://pastebin.com/0qTfWsyX
cant seem to get this simple program to work… would any one of you guys mind looking over it to see whats wrong with it?
main loop - http://pastebin.com/QPhRWUCj
Buttons - http://pastebin.com/0qTfWsyX
Can you give us a hint as to what it is that isn’t working?
Oh sorry i wrote that in a hurry lol. Plays the first pattern (rainbow) but it wont switch modes
Looks like you aren’t actually calling the button update function in your main loop. You default to effect 1, but without calling the function to read the button input, it wouldn’t change from the rainbow function.
How can i fix it?
Your main .ino file doesn’t have an #include for the Buttons.h file. I’d start there. If you saw this button example somewhere I’d go back and look at that again.
To simplify things until you know it’s working you could also move everything from Buttons.h back into your main .ino file. Once things are working then you can start organizing things out into separate files.
Also, here’s an example with a button. It checks the button every time at the end of the main loop (at line 143).
@marmil lol thanx for pointing that out man i totally overlooked it! And this is actually based on a previously working program that used switch case to switch between patterns
@marmil are there any known issues with using the teensy 3.2 with WS2812B pixels?
Issues? With a Teensy you might need to use a 74HCT245 level shifter. I would certainly recommend a 1000uF cap (16V or larger) at the beginning of the strip. Might be good to use a resistor on the Data line too. But these things aren’t really “issues”, more like what’s normally recommended or general good practices.
Ok just wanted to make sure i didnt have to use a different type of LEDs like the APA102s
Just an update. I got the code working to where patterns change with a button press and that index number is saved and read from EEPROM so when you turn it off and back on it recalls the last pattern that played