> -----Original Message----- > From: James Fitzsimons [SMTP:jamesfit@PARADISE.NET.NZ] > Sent: Wednesday, February 27, 2002 8:23 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC]:pin names as arguments in Hi-Tech C > > Hi all, > I have a question about passing the name of a pin as an argument to a > function. For example, I have a function driveservo(drivevalue, servopin) > and I might want to pass RA0 as the value for servopin. > > The thing is, if I declare the function as void drvieservo(int drivevalue, > bit servopin) the compiler throws an error. I am a bit lost as to how to > get > around this problem. I have tried a few hacks, but feel I am probably > missing something here. > > Can anyone help out a Hi-Tech C newbie? > > Thanks for any and all help, > James Fitzsimons > > P.S I don't think it should make any difference, but driveservo is > declared > in a different file (servo.c) than the file it is called from (motcont.c) > You cannot pass a 'bit' as an argument in HiTech. One possible workaround is to pass a bitmask which can be OR'd or AND'ed with the port to set or clear a bit. Mike -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics