CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

pointer to pin?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
valemike
Guest







pointer to pin?
PostPosted: Fri Jun 10, 2005 7:53 am     Reply with quote

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







PostPosted: Fri Jun 10, 2005 8:18 am     Reply with quote

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.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group