I'have been using arduino for a month now, but have now moved on to writing libraries. However I have encountered this new error which I have not yet seen before when writing scripts.
"error: invalid conversion from 'char*' to 'int'"
This refers to a function inside my library source file,
int ADNS2610::motion()
{
char arrayMotion[2];
arrayMotion[0] = readOperation(DELTA_X);
arrayMotion[1] = readOperation(DELTA_Y);
return arrayMotion;
// readOperation is another function which returns a byte data type.
}
It might be fundamental problem that I just cant see but I would really appreciate it if someone could please explain what should the return data type be (in this case i have it as int ADNS2610::motion()) and also the data type that is declared for a variable that is calling this function ( such as int x = motion()).
For this particular function i want the resulting output variable to be of char or int8_t form (-128 to 127).
I have also encountered the same error invblving another function which also uses an array. Perhaps it is how I use arrays?
Thanks for the help in advance.