I have been trying output 8 directions from the compass with 8 LEDs
The problem that keeps occurring is that the LEDs on output pins 0,1 and 2
are constantly flashing!the other 5 are just fine though!!
Here is my program :
----------------------------------------------------------------------
dirsc =%00001111 'should declare all port c as inputs
SYMBOL NORTH = pin7
SYMBOL EAST = pin6
SYMBOL SOUTH = pin5
SYMBOL WEST = pin4
main:
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
if North=0 and South=1 and East=1 and West=1 then label_11
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
if North=0 and South=1 and East=0 and West=1 then label_12
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
if North=1 and South=1 and East=0 and West=1 then label_13
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
if North=1 and South=0 and East=0 and West=1 then label_14
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
if North=1 and South=0 and East=1 and West=1 then label_15
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
if North=1 and South=0 and East=1 and West=0 then label_16
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
'pause 2000
if North=1 and South=1 and East=1 and West=0 then label_17
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
'pause 2000
if North=0 and South=1 and East=1 and West=0 then label_18
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
'pause 2000
goto main ; *****
label_11: high 7
goto main
label_12: high 6
goto main
label_13: high 5
goto main
label_14: high 4
goto main
label_15: high 3
goto main
label_16: high 2
goto main
label_17: high 1
goto main
label_18: high 0
goto main
-------------------------------------------------------------------------
So there is the program and i'd appreciate any feedback
Many Thanks
The problem that keeps occurring is that the LEDs on output pins 0,1 and 2
are constantly flashing!the other 5 are just fine though!!
Here is my program :
----------------------------------------------------------------------
dirsc =%00001111 'should declare all port c as inputs
SYMBOL NORTH = pin7
SYMBOL EAST = pin6
SYMBOL SOUTH = pin5
SYMBOL WEST = pin4
main:
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
if North=0 and South=1 and East=1 and West=1 then label_11
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
if North=0 and South=1 and East=0 and West=1 then label_12
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
if North=1 and South=1 and East=0 and West=1 then label_13
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
if North=1 and South=0 and East=0 and West=1 then label_14
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
if North=1 and South=0 and East=1 and West=1 then label_15
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
if North=1 and South=0 and East=1 and West=0 then label_16
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
'pause 2000
if North=1 and South=1 and East=1 and West=0 then label_17
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
'pause 2000
if North=0 and South=1 and East=1 and West=0 then label_18
low 7
low 6
low 5
low 4
low 3
low 2
low 1
low 0
'pause 2000
goto main ; *****
label_11: high 7
goto main
label_12: high 6
goto main
label_13: high 5
goto main
label_14: high 4
goto main
label_15: high 3
goto main
label_16: high 2
goto main
label_17: high 1
goto main
label_18: high 0
goto main
-------------------------------------------------------------------------
So there is the program and i'd appreciate any feedback
Many Thanks