I have a problem using the 28X1 in a project I am working on. I wrote the program originally for the 28X2, but wanted to take advantage of the automatic analog features of the 28X1 chip and rewrote the program. The problem is in the different port designations the 28X1 uses. This is the partial code:
It looks like that I can use the B.0-B.7 as well as the straight numerical 0 to 7 to indicate the B ports. The compiler also accept the pinC.0-pinC.7 syntax for the C ports, for it does not issue an error with the above code.
The problem is that the compiler issues an error on the last line, telling me that I should have used an "0" instead of "pinC.0". But does that not indicate the B4 (IC pin25)pin? Or is the above assumption on the B Port designations, wrong?
The question is: How do I choose between the C versus the B port using the 28x1 chip?
Any comments, suggestions?
Code:
' .---------------------------------------------------------------------------.
' | Define Input and Output Pins |
' `---------------------------------------------------------------------------'
symbol IRleft = 1 'analog input-PIN3=A1-7 right LED Array
symbol IRright = 3 'analog input-PIN5=A3-8 top LED Array
symbol IRup = 2 'analog input-PIN4=A2-9 left LED Array
symbol IRdown = 0 'analog input-PIN2=A0-3 bottom LED Array
symbol leftmotor = B.0 'servo output-PIN21 - Left Motor Servo OUT
symbol rightmotor = B.1 'servo output-PIN22 - Right Motor Servo OUT
symbol neckupdown = B.2 'servo output-PIN23 - Up/Down Servo OUT
symbol neckleftright = B.3 'servo output-PIN24 - PAN Servo OUT
symbol IRleds = B.4 'digital output-PIN25 - Output Strobe LED Array
symbol LED1OUT = pinC.0
symbol LED2OUT = pinC.1
symbol LED3OUT = pinC.2
symbol LED4OUT = pinC.3
symbol LED5IN = pinC.4
symbol LED6IN = B.5
symbol LED7IN = B.6
'Start Program
HIGH LED1OUT
The problem is that the compiler issues an error on the last line, telling me that I should have used an "0" instead of "pinC.0". But does that not indicate the B4 (IC pin25)pin? Or is the above assumption on the B Port designations, wrong?
The question is: How do I choose between the C versus the B port using the 28x1 chip?
Any comments, suggestions?