Turning on an LED with the Parallax Propeller

Propeller LED CircuitThe propeller supplies 3.3V on it's PIN when set as an output, an LED should always be protected with a resistor and a 100ohm resistor between the Propeller and LED is a safe choice (and probably something you have in stock)

Not all LEDs are the same and you may need a different value for the resistor depending on the LED, and some require more voltage and you might not even be able to drive them with a Propeller pin.

You could probably get by without a resistor, the LED *probably* won't burn out, but it'd be a bad habit to get into :)

The SPIN code to make the LED light is prety simple as well


dira[3] := 1      ' Set to output
outa[3] := 1     ' Turn it on

repeat      '  Need this otherwise the program will end and turn everything off...

and to make it blink...


dira[3] := 1    ' Set to output

     outa[3] := 1     ' Turn it on
     waitcnt(clkfreq /2 + cnt)    ' pause for a second
     outa[3] := 0     ' Turn it off