Usually i set and clear my pins with:
port_b |= 0x20; // set pin 5; 0010 0000
port_b &= ~0x80; // clear pin 7; 0111 1111
I've seen pin assignments like:
#bit PIN_STARTBUTTON port_b.2
I've got an application where I have several inputs and i want to give the user the flexibility where to stick in their "startbutton" wires. For example, they may stick it into the input connected to RB2, or they may stick it into RC0 for example
Is there such a thing as a pointer to PIN_STARTBUTTON, so that I can assign these pin assigments during runtime?
i know the tedious way to do it would be to do a bunch of ifs and elses.
Ttelmah Guest
Posted: Fri Jun 10, 2005 8:18 am
I posted a couple of routines to allow the 'pin' values to be used as variables, and to do it in just about the smallest possible space, a couple of weeks ago. A search back through the forum should find them.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum