When I try to compil a code on my Chipkit WF 32 I got a failed compiling but not on my arduino mega...
On the IDE I change the board when I compile for the arduino or digilent board. I tryed the arduino IDE and UECIDE and I get the same result, failed on the Chipkit.
I've reduce the code to show you exactly where the error come from, that's come from the convertion of the char array to unsigned integer. I don't know what's happening. If some one have an idea
Thanks
CODE :
void setup()
{
}
void loop()
{
}
int Motor_2(unsigned char numInputBytes, unsigned char* input, unsigned char* numResponseBytes, unsigned char* response)
{
//Convertion of the char Array input to unsigned interger (Step to move)
unsigned int Step_To_Move_2 = atoi(input);
}
C:\Users\pgrol\Desktop\temporaire\temporaire.ino: In function 'int Motor_2(unsigned char, unsigned char*, unsigned char*, unsigned char*)':
temporaire:12:41: error: invalid conversion from 'unsigned char*' to 'const char*' [-fpermissive]
unsigned int Step_To_Move_2 = atoi(input);
^
In file included from C:\Users\pgrol\AppData\Local\Arduino15\packages\chipKIT\hardware\pic32\2.1.0\cores\pic32/WProgram.h:8:0,
from C:\Users\pgrol\AppData\Local\Arduino15\packages\chipKIT\hardware\pic32\2.1.0\cores\pic32/Arduino.h:4,
from sketch\temporaire.ino.cpp:1:
C:\Users\pgrol\AppData\Local\Arduino15\packages\chipKIT\hardware\pic32\2.1.0\cores\pic32/stdlib_noniso.h:34:5: error: initializing argument 1 of 'int atoi(const char*)' [-fpermissive]
int atoi(const char s);
^
exit status 255
invalid conversion from 'unsigned char' to 'const char*' [-fpermissive]
Fix the function parameters; why are you saying that it's an unsigned char?
Change unsigned char* input to char* input.
The compiler settings for AVR boards and the Chipkit are different. You can see [-fpermissive] in the earlier post where I posted the compiler output for the AVR; that indicates that the compiler can decrease, for certain errors, the error level from error to warning and hence it does not stop; but it is actually still an error.
The compiler settings for the Chipkit are different (no idea where to find them as I haven't installed the board); I'm confident that it does not have the fpermissive flag in the compiler options.