void setup() {
// put your setup code here, to run once:
int potpin = A0;
int potval = 0;
//OUTPIN:use digital pin 9-11,the pulse-width Modulation (PWM) pins
//LED's cathodes should be connected to digital GND
int grnpin = 6;//grn LED connected to digpin 6;
int redpin = 7;//red LED connected to digpin 7;
int blupin = 8;//blu LED connected to digpin 8;
//program variables
int grnVal = 0;
int redVal = 0;
int bluVal = 0;
pinMode(grnpin, OUTPUT);
pinMode(redpin, OUTPUT);
pinMode(blupin, OUTPUT);
}
//Main program
void loop() {
// put your main code here, to run repeatedly:
potVal = analogRead(potpin);
if(potval <341)//
{
potVal = (potVal 3)/4;
grnval = 256-potval;
redval = potval;
bluval = 1;
}
else if (potval<682)
}