Friday, December 31, 2010

LED Test Software

12-31-2010, 04:34 AM Code 4-79 LED TEST SOFTWARE
Here's some code used to test the LED modification on the Parallax Propeller Proto Board. The modification is described in several posts. It also runs on the Parallax Demo Board by changing the pin from 24 to 23. This is the reason for the LED ghost correction.


{{

The Brain Blob
LED Mod Test on the Brain Blob Project
Blinks LED on pin 24 using the Parallax Propeller Proto Board
Use pin 23 for demo board
by Humanoido
Friday December 31, 2010

}}

CON
  _clkmode      = xtal1 + pll16x ' 80MHz clock
  _xinfreq      = 5_000_000      ' 5MHz crystal
 LED            = 24             ' LED mod is on pin 24 Proto Board, pin 23 demo board
 delay          = 40_000_000     ' Approx 1 second on and off

PUB Main
  dira[LED] := 1          ' Set LED pin as output
  dira[22]  := 1          ' correct ghost led on demo board
  outa[22] := 0           ' correct ghost led
  outa[LED] := 1          ' Initialize pin on
  repeat                  ' Loop below
    blink                 ' Do Private Method to blink LED
  
PRI Blink                 ' Private Method to blink LED
  !outa[LED]              ' Toggle state LED
  waitCnt(delay+cnt)      ' Delay