Hi everyone,
I am using CCS C and I would like to pass a pin name to a function, like this:
Code:
#define Test_Pin Pin_D0
void test(int pin)
{
output_high(pin); // want Pin_D0 to go high
output_low(pin); // want Pin_D0 to go low
}
main()
{
test(Test_Pin);
}
Somehow, this code doesn't work. Is there anyway around this?
Regards,
Thomas
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Wed Feb 25, 2004 9:12 pm
Look down near the end of this thread. Mark has posted
two functions that let you pass a CCS-style pin number
as an argument. I think this may solve your problem.
http://www.ccsinfo.com/forum/viewtopic.php?t=18233
thomasn101 Guest
Posted: Thu Feb 26, 2004 2:33 pm
Thank you very much for your help! It solves my problem.
Best regards,
Thomas
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