out0 = 1?
nick bernard
Posts: 329
Hail all,
i have an existing pcb for an old project that i'm toying with and i cannot seem to get this snippit functioning
i have an led bar graph on the pcb for indication; anode to pin, cathode to sip resistor network thats pulled down...
the led's work fine with TOGGLE L1 commands. but the L1 = 1 type script doesnt werk... what gives? anyone?
rox on
Nick B
'{$STAMP BS2e}
'{$PBASIC 2.5}
L1 PIN 1
L2 PIN 3
L3 PIN 5
L4 PIN 7
L5 PIN 9
L6 PIN 11
L7 PIN 13
L8 PIN 15
ax VAR Byte
DELAY CON 50
Main:
DO
PAUSE Delay
ax = ax + 1
GOSUB Bar_Graph
LOOP
Bar_Graph:
L1 = ax.BIT0
L2 = ax.BIT1
L3 = ax.BIT2
L4 = ax.BIT3
L5 = ax.BIT4
L6 = ax.BIT5
L7 = ax.BIT6
L8 = ax.BIT7
RETURN
Post Edited (nick bernard) : 11/12/2004 9:48:31 PM GMT
i have an existing pcb for an old project that i'm toying with and i cannot seem to get this snippit functioning
i have an led bar graph on the pcb for indication; anode to pin, cathode to sip resistor network thats pulled down...
the led's work fine with TOGGLE L1 commands. but the L1 = 1 type script doesnt werk... what gives? anyone?
rox on
Nick B
'{$STAMP BS2e}
'{$PBASIC 2.5}
L1 PIN 1
L2 PIN 3
L3 PIN 5
L4 PIN 7
L5 PIN 9
L6 PIN 11
L7 PIN 13
L8 PIN 15
ax VAR Byte
DELAY CON 50
Main:
DO
PAUSE Delay
ax = ax + 1
GOSUB Bar_Graph
LOOP
Bar_Graph:
L1 = ax.BIT0
L2 = ax.BIT1
L3 = ax.BIT2
L4 = ax.BIT3
L5 = ax.BIT4
L6 = ax.BIT5
L7 = ax.BIT6
L8 = ax.BIT7
RETURN
Post Edited (nick bernard) : 11/12/2004 9:48:31 PM GMT
Comments
DIRS = %1010101010101010
A "1" makes the pin an output, "0" an input. Put this line of code before Main.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
wow super fast...
uber cool jon will do
thx a mil
nick B