Author Topic: Question for typ in signatur  (Read 1651 times)

0 Members and 1 Guest are viewing this topic.

Offline PAT_McUserTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 1
  • I just started with robitic.
Question for typ in signatur
« 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;
}
I just started with robitic.

PS.: you have to sorry my bad english.

Offline PAT_McUserTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 1
  • I just started with robitic.
Re: Question for typ in signatur
« Reply #1 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.
« Last Edit: April 08, 2010, 09:41:29 AM by PAT_McUser »
I just started with robitic.

PS.: you have to sorry my bad english.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: Question for typ in signatur
« Reply #2 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?

Offline PAT_McUserTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 1
  • I just started with robitic.
Re: Question for typ in signatur
« Reply #3 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...
I just started with robitic.

PS.: you have to sorry my bad english.

Offline PAT_McUserTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 1
  • I just started with robitic.
Re: Question for typ in signatur
« Reply #4 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.
I just started with robitic.

PS.: you have to sorry my bad english.

 


data_list