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

Using input() with a variable

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







Using input() with a variable
PostPosted: Thu Sep 28, 2006 9:41 am     Reply with quote

Hello I’m hoping someone can help me out with this, basically I have a structure define as below

Code:

struct meter_input 
{
   byte input;
   long count;
   char status;
};


I then have structure like the below

Code:

STRUCT meter_input _10pCoinInput=
{
   PIN_B0,
   0,
   LO,   

};


Where input is used to store the pin to be read with the library function input()

I call the function

ReadStatus(&_10pCoinInput);

The ReadStatus is as follows
Code:

void ReadStatus(struct meter_input *meter)
{



   if(meter->status==HIGH)         //is the status high
   {                        
      if(!input(meter->input))      //has the input dropped low
      {
         meter->status=LO;
         meter->count++;
      }
      else
      {
         return;
      }
   }
   else………………………

However this gives a error
Expression must evaluate to a constant

As far as I’m awear it does? Input is PIN_B0, I’ve tried defining input with a const ie const byte input; but this gives an error can anyone advise?
Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Sep 28, 2006 10:06 am     Reply with quote

This thread has links to the routines:
http://www.ccsinfo.com/forum/viewtopic.php?t=27923&highlight=18f+16f
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