RGB led wont change color correctly.
the code is at andyspam.com/code.html since instructables wont let me paste.
please help,
thanks in advanced.
8
answers
|
Answer it!
|
digitalWrite(redPin, LOW);
digitalWrite(bluePin, LOW);
digitalWrite(greenPin, HIGH);
digitalWrite(redPin, HIGH);
if (sensorValue >= 700) && {sensorValue <1024) digitalWrite(bluePin,HIGH);
Is there a way of preserving formatting ? like the old <pre> tags ?
Steve
I'm a beginner so my codes are a little buggy.
Steve
Text in a pre element is displayed in a fixed-width font, and it preserves both spaces and line breaksClick the Source button and use a <PRE> tag.
L
If I read you code correctly, at values above 700, these conditions are all true:
sensorValue > 100 (greenPin,HIGH)
sensorValue > 400) (redPin, HIGH)
sensorValue > 700) (bluePin, HIGH)
You want some of them to go LOW at higher values, this code just turns each colour on progressively without turning them off again.
L
![]() |
































