Page 1 of 1

expected declaration specifiers error

Posted: Wed Sep 19, 2018 6:51 am
by percy.jaiswal
Hello, when I am trying to add a function "void motorsSetRatio(0, 10);" into main.c, I am getting below shown error. It sounds like I am missing something silly, but can you help me with this? I have included motors.h header file.

expected declaration specifiers or '...' before numeric constant
void motorsSetRatio(0, 10);
^
src/init/main.c:63:26: error: expected declaration specifiers or '...' before numeric constant
void motorsSetRatio(0, 10);

Re: expected declaration specifiers error

Posted: Fri Sep 21, 2018 4:10 pm
by percy.jaiswal
Hello,

Can someone please help me understand commands I should use in Crazyflie firmware to control individual motors. As mentioned above, I am trying to use motorsSetRatio(), but I am getting error with that.

Thanks!

Re: expected declaration specifiers error

Posted: Mon Oct 08, 2018 12:02 pm
by arnaud
If you are writing this line in a function, it is not legal C. You should remove the 'void to call the motorSetRatio function. If you want to declare a function, the argument signature needs to be in the parenthesis, not values.

What are you trying to achieve at higher level? You should virtually never have to touch main.c in the Crazyflie firmware unless you are touching the architecture of the firmware, so if you tell us a bit more about what you want to achieve we could tell you where and how it can best be implemented.