Gday
Popping my cherry here today.... firsts in many ways.
I admit to being a complete ludite with regard to programming in general and C++ in particular, so if this query fits better elsewhere, please just point the way.
I am setting up GPS via I2C Nav board to a MultiWii Flight controller; using an FTDI interface to my laptop (all firsts except for the laptop).
I have managed to flash the GPS board without issue; and recognised that port and Baud rates are correct. My laptop sees the I2C interface board but i cannot flash it due to the following.....
The provided software sketch requires two minor changes to the code - 1 line defined and another "commented out" in the "config.h" tab.
When attempting to verify and upload I get this little gem - which is probably extremely basic to you guys but at this stage for me is total (well almost) gibberish.
PIDCtrl.h:87: error: 'constexpr' needed for in-class initialization of static data member 'const float PIDCtrl::_filter' of non-integral type [-fpermissive]
static const float _filter = 15.9155e-3; // Set to "1 / ( 2 * PI * 10 )";
^
exit status 1
'constexpr' needed for in-class initialization of static data member 'const float PIDCtrl::_filter' of non-integral type [-fpermissive]
I know it relates to the PID settings of the quadcopter somehow, but what it means etc has me baffled
This seems to relate to a different tab in the sketch that has not been modified.
Can you please advise what it means, how to fix or where to take my issue.
Thanks
HueySyd:
PIDCtrl.h:87: error: 'constexpr' needed for in-class initialization of static data member 'const float PIDCtrl::_filter' of non-integral type [-fpermissive]
static const float _filter = 15.9155e-3; // Set to "1 / ( 2 * PI * 10 )";
Well since nobody else has replied yet I'll give this a try. It seems the fix is to either change PIDCtrl.h line 87 to:
static constexpr float _filter = 15.9155e-3; // Set to "1 / ( 2 * PI * 10 )";
or:
const float _filter = 15.9155e-3; // Set to "1 / ( 2 * PI * 10 )";
Which is best? I don't know, maybe someone will tell us but you can try those changes out.
I believe this sketch was written for Arduino IDE 1.0.x and it looks like you are compiling with 1.6.x so the different compiler versions cause this issue and you may also run into the prog_char error which is also easily fixed.
Thanks for your reply and assistance
I tried both modifications as you suggested but neither fixed the issue.
I managed to find a different sketch online (I2C_GPS_NAV_latest.rar) which does compile as expected, therefore my initial problem is no longer........
Of course it seems that it cannot be that easy - now when trying to upload there is another issue avrdude: stk500_recv(): programmer is not responding.
I am busy trying to find a solution to this and it appears to be a fairly common issue - however with a wide variety of fixes..... perhaps you could point me in the right direction?
Thanks