Happy Accident

While working on the PWM project, I changed one part of the code which was the

redValue = max(0, min(redSensorValue * 1.4 – 840, 255));

greenValue = max(0, min(greenSensorValue * 0.9 – 400, 255));

blueValue = max(0, min(blueSensorValue * 0.8 – 250, 255));

to

 

// redValue = redSensorValue 255;
// greenValue = greenSensorValue 255;
// blueValue = blueSensorValue 255;

 

What this does is blink the light red and blue depending on light source,  and stops when covered.

Example here:

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>