Symbolic portC

Coyoteboy

Senior Member
Hi all. I'm setting up an experiment for some students and wish to simplify the coding as much as possible. Currently the experiment uses almost every pin on the 40x, so they have enough to be worrying about without dealing with pins and ports if it can be helped. I can normally use
Code:
symbol THIS_PIN = pin0
But can I use:
Code:
symbol THIS_PIN = portC pin0
ideally allowing the students to initially lay out a pin map, then not have to consult it again while using the pins, or is the interpreter not capable of this?
 

womai

Senior Member
Unfortunately, you cannot include the "portc" in the symbol definition; you'll have to add it whenever you use the symbol. I know this is a pain because it's easy to forget - don't ask how many times I wrote something like "high MYPIN" instead of "high portc MYPIN" and then wondered why my program did not work. The best workaround I found is to include portc as part of the symbol name so at least it reminds you to add the portc:

symbol PORTC_MYPIN = 0

...

high portc PORTC_MYPIN

Wolfgang
 

Coyoteboy

Senior Member
OK, cheers, well thats a bit of bad news but I suppose it isnt the end of the world!
We might end up with X2 parts anyway at this rate, which would help.
 

BCJKiwi

Senior Member
Agree with SS,

Have been wondering if the Port.Pin designation system for the X2's could not be 'retrofitted' via the program editor for the older chips thus providing a new consistent command structure across the range.
 
Top