PWM (Pulse Width Modulation)

Using PWM to create a three colour light sensitive LED.

To create this project I striped the board apart from the red power cable and the black ground cable connected between the Arduino board and breadboard. Then I added:

Three photo-resistors one for green, blue and red.  These when then attached to grounding resistors (10K), analogue A0,A1,A2 pins and power from the opposite side of the board by a wire attached across one end to the other.

Next was to add the Multi-colour LED ( cathode) which has a Red pin, then the cathode pin (for grounding), then the Blue and Green pins.  Once in each pin has to be powered by a Digital PWM pin (3,9,10,11,12) or any pin with a tilde sign ~  and then each grounded by 220 ohms…..code time.

Here is an image of my code working and the project working.

WP_20140529_023 WP_20140529_024 WP_20140529_025WP_20140529_026

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>