Unsigned int thisBlip = 1 // 1 to begin the loop With the delay in there the way it is now, it completes the whole animation in about 1 second. It executes blindingly fast without the delay - in fact, it runs so fast you can't even see it run at all. It rolls 3 sequential LEDs "down" in sequence, then back "up" to the top as a cute little startup animation using the 33.3/45/78 RPM indicator LEDs in my Arduino-controlled record player originally, this was a massive block of sequential code where each step in the sequence was hard-coded. I spent about 2 hours sequencing these values and making sure they work right. well, I think I may have a segment of code that'll help. Im new to arduino and havnt time to learn it all from scratch as ive other projects to work on so im trying to use code I can find on net and modify it to save some time but Im starting to realise this is harder than I thought! Im just having problems combining the two programs, im not looking for a smooth fade, If I was I would have plenty of code to pick from, Problem is that I need the brightness to die right down before next colour comes in,Ĭan anyone offer any assistance or point me in the direction of something similar thats already out there? If(COLOR_MIX = 7) //if all color combinations have been displayed, reset the cycle Void led_mixer(int color, int x) //uses switch statement to mix color combinationsįade_in(MAX_BRIGHT) //gradually turn the LED on to max brightnessįade_out(MAX_BRIGHT) //gradually turn off the LEDĬOLOR_MIX++ //increment to the next color combination Void fade_in(int x) //loop that gradually turns the LED on using PWM Int COLOR_MIX = 0 //variable to change the colors that are mixed in switch statement Int MAX_BRIGHT = 255 //sets maximum brightness, 255 max brightness Int DELAY_TIME = 15 //changes speed of fading Int BLUE = 7 // BLUE pin of the LED to PWM pin 11 Int GREEN = 6 // GREEN pin of the LED to PWM pin 10 Int RED = 5 // RED pin of the LED to PWM pin 9 Through every available color combination with Ive found some code for a nice breathing effect on a single colour LED : int ledPin = 13 He wants a "Breathing" "Pulsating" or "Throbbing" effect that dims right down to near or complete darkness before building up again in next colour in sequence. Im Trying to help a friend of mine with a RGB LED Control system for giant kaleidoscopes hes building, he is looking for a specific effect and Im having trouble finding anything similar on the web:
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |