REVERSE Example | Syntax |
' ------------------------------------------------------------------------- ' Program Description ' ------------------------------------------------------------------------- ' ' Allows an LED to have one of two brighness levels by controlling port ' pin with REVERSE. When the LED pin is an input (Hi-Z), the current ' passes through both resistors, causing the LED to be dim. When the ' LED pin is an output low, the current only has to pass through one ' resistor, hence the LED is brighter. ' ------------------------------------------------------------------------- ' Device Settings ' ------------------------------------------------------------------------- DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX FREQ 4_000_000 ID "REVERSE" ' ------------------------------------------------------------------------- ' IO Pins ' ------------------------------------------------------------------------- Led VAR RB.0 ' ========================================================================= PROGRAM Start ' ========================================================================= ' ------------------------------------------------------------------------- ' Program Code ' ------------------------------------------------------------------------- Start: Led = 0 ' put low in output bit Main: DO PAUSE 250 ' wait 1/4 second REVERSE Led ' change brightness LOOP