I just started programming Arduinos. I am kind of good at programming in general, but mainly do stuff with components like resistors, capacitors, inductors, relays, diodes etc. Micro-controllers are very new to me. I just got an Arduino Uno and have been able to program it to do some stuff.
I have made an RGB LED blink on and off, switch between random colors, and basic things like that (by creating variables, using digital and analog write, delay, and random). I have begun to do stuff with if/then/else statements and analog and digital read. For example, depending on the input from a photoresistor, an RGB LED either turns on and changes between different colors or, if there is already enough light, it turns off.
I want to make it so that you press a push button and the RGB led blinks rapidly, press it again and it blinks slowly, then if pressed one more time it turns off. After turned off it should be able to go though the cycle again. What is the best approach to doing this? Also, some sample code would be helpful.
I have made an RGB LED blink on and off, switch between random colors, and basic things like that (by creating variables, using digital and analog write, delay, and random). I have begun to do stuff with if/then/else statements and analog and digital read. For example, depending on the input from a photoresistor, an RGB LED either turns on and changes between different colors or, if there is already enough light, it turns off.
I want to make it so that you press a push button and the RGB led blinks rapidly, press it again and it blinks slowly, then if pressed one more time it turns off. After turned off it should be able to go though the cycle again. What is the best approach to doing this? Also, some sample code would be helpful.