Pages: [1]   Go Down
Author Topic: 5050 RGB LED strip controller  (Read 1319 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
1) On
At this point turning the rotary encoder will change the HUE of the LEDs.
2) Change luminosity of LEDs using the microphone
At this point turning the rotary encoder will change the HUE of the LEDs.
3) Change hue of LEDS using the microphone
At this point turning the rotary encoder will change the luminosity of the LEDs.
4) Hue of LEDS change randomly, speed controlled by rotary encoder (ex. turning encoder gives a delay from 0-10)
5) 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.
Quote
   1.   //Van der Stappen ©
   2.    
   3.   #define REDPIN 5  
   4.   #define GREENPIN 6
   5.   #define BLUEPIN 3
   6.    
   7.   int redNow;
   8.   int blueNow;
   9.   int greenNow;
   10.   int redNew;
   11.   int blueNew;
   12.   int greenNew;
   13.    
   14.   void setup()
   15.   {
   16.     pinMode(7,INPUT); //SIG of the Parallax Sound Impact Sensor connected to Digital Pin 7
   17.     pinMode(REDPIN, OUTPUT);
   18.     pinMode(GREENPIN, OUTPUT);
   19.     pinMode(BLUEPIN, OUTPUT);
   20.     redNow = random(255);
   21.     blueNow = random(255);
   22.     greenNow = random(255);
   23.     redNew = redNow;
   24.     blueNew = blueNow;
   25.     greenNew = greenNow;
   26.    
   27.   }
   28.    
   29.   #define fade(x,y) if (x>y) x--; else if (x<y) x++;
   30.    
   31.   void loop()
   32.   {
   33.     boolean soundstate = digitalRead(7);
   34.     if (soundstate == 1) {
   35.       analogWrite(BLUEPIN, blueNow);
   36.       analogWrite(REDPIN, redNow);
   37.       analogWrite(GREENPIN, greenNow);
   38.       redNew = random(255);
   39.       blueNew = random(255);
   40.       greenNew = random(255);
   41.       // fade to new colors
   42.       while ((redNow != redNew) ||
   43.         (blueNow != blueNew) ||
   44.         (greenNow != greenNew))
   45.       {
   46.         fade(redNow,redNew)
   47.           fade(blueNow,blueNew)
   48.             fade(greenNow,greenNew)
   49.               analogWrite(BLUEPIN, blueNow);
   50.         analogWrite(REDPIN, redNow);
   51.         analogWrite(GREENPIN, greenNow);
   52.         delay(1);
   53.       }
   54.     }
   55.     else{
   56.       digitalWrite(REDPIN,0);
   57.       digitalWrite(GREENPIN,0);
   58.       digitalWrite(BLUEPIN,0);
   59.     }
   60.   }
"
Logged

Pages: [1]   Go Up
Jump to: