Changes

Jump to navigation Jump to search
Line 241: Line 241:  
* Change the code to test your other potentiometer.  
 
* Change the code to test your other potentiometer.  
   −
At this point we should test the LED lights (make sure they are plugged in). Prior to the setup function in your code, add in the following lines:
+
At this point we should test the LED lights (make sure they are plugged in). Prior to the setup function in your code, add in the following lines:<pre>
<code><pre>
   
#define REDPIN (10)
 
#define REDPIN (10)
 
#define GREENPIN (3)
 
#define GREENPIN (3)
#define BLUEPIN (11)
+
#define BLUEPIN (11)</pre>
</pre></code>
+
And then, in your setup, add in the following:<pre>
 
  −
And then, in your setup, add in the following:
  −
<code><pre>
   
   pinMode(REDPIN, OUTPUT);
 
   pinMode(REDPIN, OUTPUT);
 
   pinMode(GREENPIN, OUTPUT);
 
   pinMode(GREENPIN, OUTPUT);
Line 255: Line 251:  
   analogWrite(REDPIN, 255);
 
   analogWrite(REDPIN, 255);
 
   analogWrite(GREENPIN, 255);
 
   analogWrite(GREENPIN, 255);
   analogWrite(BLUEPIN, 255);
+
   analogWrite(BLUEPIN, 255);</pre>
</pre></code>
  −
 
   
When you run this code, it should turn the LED's all on, which will make a bright white light. Cool.  
 
When you run this code, it should turn the LED's all on, which will make a bright white light. Cool.  
    
Finally, when all appears to be working, download the [[Media:Mood_Light_Fader_Code.zip|fader code]] and test it. You should have a functioning system now! Congratulations.
 
Finally, when all appears to be working, download the [[Media:Mood_Light_Fader_Code.zip|fader code]] and test it. You should have a functioning system now! Congratulations.

Navigation menu