In our last entry, “Exploring the Netduino #3: Building the circuit on a Breadboard“, we covered the step-by-step method to wire up the proposed schematic for switching an LED on and off via a power MOSFET. In this entry, we are going to get to the fun stuff: CODE!
But first, a little bit on LEDs…
Light Emitting Diodes (LEDs) may function a lot like (incandescent) lightbulbs, but they should never be treated like them. Like lightbulbs, LEDs can be dimmed by controlling the forward voltage. Unlike light bulbs, this range tends to be rather narrow and as such is somewhat difficult to control. Fortunately, dimming LEDs can happen another way that is particularly easy to do with a digital circuit: Pulse Width Modulation (PWM).