expected declaration specifiers error

Firmware/software/electronics/mechanics
Post Reply
percy.jaiswal
Beginner
Posts: 14
Joined: Sun Apr 01, 2018 4:23 am

expected declaration specifiers error

Post 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);
percy.jaiswal
Beginner
Posts: 14
Joined: Sun Apr 01, 2018 4:23 am

Re: expected declaration specifiers error

Post 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!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: expected declaration specifiers error

Post 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.
Post Reply