Hi all. I've been a lurker on this forum for about 5 years and have built many 08, 08m, 18A and 18x projects and always found the results to my problems here.
My programs are wanting more I/O pins so the 28X2 is the next chip to play with.
When I run a syntax check, I get an error when using the following code. Can someone help me get my head around the configuring of Ports A,B, & C on the 28x2. Any help is apreciated.
Im using PE 5.2.7 the 28X2 FW is B.1
Thanks
Murray from NZ
My programs are wanting more I/O pins so the 28X2 is the next chip to play with.
When I run a syntax check, I get an error when using the following code. Can someone help me get my head around the configuring of Ports A,B, & C on the 28x2. Any help is apreciated.
Im using PE 5.2.7 the 28X2 FW is B.1
Thanks
Murray from NZ
Code:
#picaxe 28X2 'Compile with 28X2
'***** Inputs Port A *****
symbol ADC0 = 0 'ADC - 0
symbol ADC1 = 1 'ADC - 1
symbol PA2 = A.2 'PortA pin2 - Active Low)
symbol PA3 = A.3 'PortA pin3 - Active Low)
symbol Temp = b1 'Temp Val
symbol Temp1 = b2 'Temp Val
'***********************************************************
Init:
let dirsA = %00000000 'Set port A as Inputs
let dirsB = %11111111 'Set port B as Outputs
let dirsC = %11111111 'Set port C as Outputs
let adcsetup = 2 'Setup ADC on A.0 and A.1
Main:
readADC ADC0,TEMP 'Read ADC value
readADC ADC1,TEMP1 'Read ADC value
sertxd ("ADC0 = ",#TEMP," ADC1 = ",#Temp1,CR,LF)
' The above works as expected
' Both the next two lines give syntax errors
if PA2 = 0 then Blah1 'If PA2 goes LOW >Blah1
if PA3 = 0 then Blah2 'If PA3 goes LOW >Blah2
pause 100
goto Main
Blah1:
sertxd ("Port A.2 = Low",CR,LF)
pause 100
goto Main
Blah2:
sertxd ("Port A.3 = Low",CR,LF)
pause 100
goto Main