The result will be based on this table
Code:
state of inputs state of outputs
============== ================
0000 0000000001
0001 0000000010
0010 0000000100
0011 0000001000
0100 0000010000
0101 0000100000
etc
simple code here...
Code:
ADCON1=7 ;disable ADC
TRISB=$FF
TRISA=0
TRISC=0
InputBCD VAR PORTB
Out1_8 VAR PORTA ;first 5 LEDs
Out9_10 VAR PORTC ;last 5 LEDs
GetInput VAR BYTE
BCDToDEC VAR BYTE
Out1_5=0
Out6_10=0
start:
Getinput=InputBCD
Select case Getinput
Case is<=5
Out6_10=0
BCDToDEC=dcd Getinput
Out1_5= BCDToDEC
Case is>=6
Out1_5=0
BCDToDEC=dcd (GetInput-6)
Out6_10= BCDToDEC
End Select
goto start
it's suppose to work. Try and post reply on this. There's several different way to do this
Last edited by mister_e; - 3rd November 2004 at 06:12.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks