Rgb Light Dimmer - DFRobot DFR0100 Manual

Beginner kit for arduino v3
Table of Contents

Advertisement

25/06/2015
12.RGB Light Dimmer
?
1
/*
2
   RGB Light Dimmer
3
*/
4
 
int
redPin = 9;                // R – digital 9   
5
 
int
greenPin = 10;             // G – digital 10
6
 
int
bluePin = 11;              // B – digital 11
7
 
int
potRedPin = 0;             // potentiometer 1 – analog 0
8
 
int
potGreenPin = 1;           // potentiometer 2 – analog 1
9
 
int
potBluePin = 2;            // potentiometer 3 – analog 2
10
 
11
 
void
setup(){
12
   pinMode(redPin,OUTPUT);
13
   pinMode(greenPin,OUTPUT);
14
   pinMode(bluePin,OUTPUT);
15
   Serial.begin(9600);         
16
}
17
 
18
 
void
loop(){
19
 
   int
potRed = analogRead(potRedPin);    
20
 
   int
potGreen = analogRead(potGreenPin);
21
 
   int
potBlue = analogRead(potBluePin); 
22
 
 
http://www.dfrobot.com/wiki/index.php/DFRduino_Beginner_Kit_For_Arduino_V3_SKU:DFR0100
DFRduino Beginner Kit For Arduino V3 SKU:DFR0100 ­ Robot Wiki
15/23

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DFR0100 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents