Society of Robots - Robot Forum

Software => Software => Topic started by: PAT_McUser on April 08, 2010, 03:25:20 AM

Title: Question for typ in signatur
Post by: PAT_McUser on April 08, 2010, 03:25:20 AM
hi, my issue is that I want create a method that returns by given Port and Port_numb a calculation of sensor data.
I want to call with something like
Code: [Select]
int a;
a=Data(PINA,0);

My question is how the signature of the method Data has to look like for Argument "PINA".
What must I replace the "????" in the following code to get the prog running?

Code: [Select]
int Data( ???? P, int N)
{
  int erg;
  if(bit_is_set(P,N)){
    //do something math stuff
  }
  return erg;
}
Title: Re: Question for typ in signatur
Post by: PAT_McUser on April 08, 2010, 05:16:09 AM
Quote
Maybe unsigned char is the the solution. I'm will test it in 3-4h.
unsigned char definitely doesn't work.
Title: Re: Question for typ in signatur
Post by: waltr on April 08, 2010, 09:58:28 AM
Quote
bit_is_set(P,N)
What data type is P declared as in the bit_is_set function?
Title: Re: Question for typ in signatur
Post by: PAT_McUser on April 08, 2010, 10:04:30 AM
Quote
bit_is_set(P,N)
What data type is P declared as in the bit_is_set function?

I don't know...
Title: Re: Question for typ in signatur
Post by: PAT_McUser on April 08, 2010, 01:07:13 PM
Quote
bit_is_set(P,N)
What data type is P declared as in the bit_is_set function?

I don't know...

its port, but it doesn't work.