Hello Nafetts.
Can't test this code, but it can be used as Psuedo...
TRISB="11111111"
TRISD="00000000"
main:
Portd=0
If Portb.0=1 then Portd=1
if Portb.1=1 then Portd=Portd+2
If Portb.2=1 then Portd=Portd+4
if Portb.3=1 then POrtd=Portd+8
if Portb.4=1 then Portd=Portd+16
if Portb.5=1 then POrtd=Portd+32
if Portb.6=1 then POrtd=Portd+64
if Portb.7=1 then portd=Portd+128
Pause 1000 (pause 1 second)
goto main
end
I believe there is a way to access this through a loop,
but I dont' have my PBP with me to give you proper code.
Dwayne
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
Bookmarks