So I am looking for help with coding. I am willing to pay and work something out with someone who can code me the following
I want to control an RGB LED 5050 strip using an arduino with a rotary encoder which has a pushbutton function on it (it has 5 pins) Each number represents pushing the rotary encoder once.
- On
At this point turning the rotary encoder will change the HUE of the LEDs. - Change luminosity of LEDs using the microphone
At this point turning the rotary encoder will change the HUE of the LEDs. - Change hue of LEDS using the microphone
At this point turning the rotary encoder will change the luminosity of the LEDs. - Hue of LEDS change randomly, speed controlled by rotary encoder (ex. turning encoder gives a delay from 0-10)
- Off
I do have some code that will change the huge of the LEDs based of of an input from an electic mike so its just a matter of altering it now to do the rest.
- //Van der Stappen ©
- #define REDPIN 5
- #define GREENPIN 6
- #define BLUEPIN 3
- int redNow;
- int blueNow;
- int greenNow;
- int redNew;
- int blueNew;
- int greenNew;
- void setup()
- {
- pinMode(7,INPUT); //SIG of the Parallax Sound Impact Sensor connected to Digital Pin 7
- pinMode(REDPIN, OUTPUT);
- pinMode(GREENPIN, OUTPUT);
- pinMode(BLUEPIN, OUTPUT);
- redNow = random(255);
- blueNow = random(255);
- greenNow = random(255);
- redNew = redNow;
- blueNew = blueNow;
- greenNew = greenNow;
- }
- #define fade(x,y) if (x>y) x--; else if (x<y) x++;
- void loop()
- {
- boolean soundstate = digitalRead(7);
- if (soundstate == 1) {
- analogWrite(BLUEPIN, blueNow);
- analogWrite(REDPIN, redNow);
- analogWrite(GREENPIN, greenNow);
- redNew = random(255);
- blueNew = random(255);
- greenNew = random(255);
- // fade to new colors
- while ((redNow != redNew) ||
- (blueNow != blueNew) ||
- (greenNow != greenNew))
- {
- fade(redNow,redNew)
- fade(blueNow,blueNew)
- fade(greenNow,greenNew)
- analogWrite(BLUEPIN, blueNow);
- analogWrite(REDPIN, redNow);
- analogWrite(GREENPIN, greenNow);
- delay(1);
- }
- }
- else{
- digitalWrite(REDPIN,0);
- digitalWrite(GREENPIN,0);
- digitalWrite(BLUEPIN,0);
- }
- }
"