It has blinky lights to give you a idea what is happening on the chips...as well as if they are ready to send/Receive.. Thus, the lights can be removed.
Recieve part.........
TRISa=%00110000
TRISb=%00000000
Counter var byte
Counter2 var byte
Result var byte
Pause 500
Porta.0=0
Porta.7=0
Portb=13 'clear lcd
Porta.0=1
Pause 1
Porta.0=0
'Flashes LED
Porta.1=1
Pause 1000
Porta.1=0
Counter=0
Loop3
Counter2=0
Result=0
Loop2:
if Porta.4=0 then Loop2
Result.0=Porta.5
Result=Result << 1
kt:
if porta.4=1 then kt
Counter2=Counter2+1
if Counter2 < 4 then Loop2
Result=Result+48
Counter2=0
Porta.7=1
Portb=Result
Porta.0=1
Porta.0=0
Counter=Counter+1
if Counter=16 then
Porta.7=0
Portb=1 'clear lcd
Porta.0=1
Pause 1
Porta.0=0
Counter=0
endif
Pause 3
goto Loop3
end
Tranmit part...........
ANSEL=%00111000
CMCON=%00010111
TRISIO=%00011100
ADCON0=%00001100
DEFINE ADC_BITS 10
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 50
counter var byte
counter2 var byte
Digloop var byte
Dignum var byte
Number var word
Number=1234
Loop:
GPIO.5=1
Pause 300
GPIO.5=0
Pause 300
if GPIO.2=0 then Loop
GPIO.0=0
ADCIN 3, number
number = number >> 6
For counter = 3 to 0 step -1
DigNum=number dig counter
for counter2= 1 to 4 step 1
GPIO.1=DigNum.3
GPIO.0=1
Pauseus 50
GPIO.0=0
Pauseus 500
DigNum = DigNum << 1
next counter2
Pause 10
Next counter
Goto Loop
End
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