Problem Compiling for Feather M0 Bluefruit LE
Please be positive and constructive with your questions and comments.
pusky
Posts: 29 Joined: Sun Mar 17, 2013 12:09 pm
Post
by pusky » Sat Dec 04, 2021 8:56 pm
Hello,
I have a
Mini Round Robot Chassis Kit - 2WD with DC Motors
DC Motor + Stepper FeatherWing Add-on For All Feather
Adafruit Feather M0 Bluefruit LE
FeatherWing Doubler - Prototyping Add-on For All Feather
I am trying to use
https://github.com/housewithinahouse/Tw ... botLibrary and I get compile errors with the Adafruit Feather M0 Bluefruit LE (See below for error messages), but if I use my Adafruit Feather 32u4 Adalogger it complies great.
the issue is that I would like to use the Adafruit Feather M0 Bluefruit LE so I can take advantage of the Bluetooth LE.
Any assistance would be appreciated..
thank you
Pasquale
Code: Select all
/home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.cpp:62:6: error: default argument given for parameter 1 of 'void TwoWheelRobot::forward(int)'
62 | void TwoWheelRobot::forward(int segment_length = _default_segment_length)
| ^~~~~~~~~~~~~
In file included from /home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.cpp:7:
/home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.h:41:10: note: previous specification in 'void TwoWheelRobot::forward(int)' here
41 | void forward(int segment_length = _default_segment_length);
| ^~~~~~~
/home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.cpp:71:6: error: default argument given for parameter 1 of 'void TwoWheelRobot::backward(int)'
71 | void TwoWheelRobot::backward(int segment_length = _default_segment_length)
| ^~~~~~~~~~~~~
In file included from /home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.cpp:7:
/home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.h:42:10: note: previous specification in 'void TwoWheelRobot::backward(int)' here
42 | void backward(int segment_length = _default_segment_length);
| ^~~~~~~~
/home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.cpp:80:6: error: default argument given for parameter 1 of 'void TwoWheelRobot::right(int)'
80 | void TwoWheelRobot::right(int segment_length = _default_segment_length)
| ^~~~~~~~~~~~~
In file included from /home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.cpp:7:
/home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.h:44:10: note: previous specification in 'void TwoWheelRobot::right(int)' here
44 | void right(int segment_length = _default_segment_length);
| ^~~~~
/home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.cpp:89:6: error: default argument given for parameter 1 of 'void TwoWheelRobot::left(int)'
89 | void TwoWheelRobot::left(int segment_length = _default_segment_length)
| ^~~~~~~~~~~~~
In file included from /home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.cpp:7:
/home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.h:43:10: note: previous specification in 'void TwoWheelRobot::left(int)' here
43 | void left(int segment_length = _default_segment_length);
| ^~~~
/home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.cpp:98:6: error: default argument given for parameter 1 of 'void TwoWheelRobot::backwardRight(int)'
98 | void TwoWheelRobot::backwardRight(int segment_length = _default_segment_length)
| ^~~~~~~~~~~~~
In file included from /home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.cpp:7:
/home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.h:48:10: note: previous specification in 'void TwoWheelRobot::backwardRight(int)' here
48 | void backwardRight(int segment_length = _default_segment_length);
| ^~~~~~~~~~~~~
/home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.cpp:107:6: error: default argument given for parameter 1 of 'void TwoWheelRobot::forwardRight(int)'
107 | void TwoWheelRobot::forwardRight(int segment_length = _default_segment_length)
| ^~~~~~~~~~~~~
In file included from /home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.cpp:7:
/home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.h:47:10: note: previous specification in 'void TwoWheelRobot::forwardRight(int)' here
47 | void forwardRight(int segment_length = _default_segment_length);
| ^~~~~~~~~~~~
/home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.cpp:116:6: error: default argument given for parameter 1 of 'void TwoWheelRobot::backwardLeft(int)'
116 | void TwoWheelRobot::backwardLeft(int segment_length = _default_segment_length)
| ^~~~~~~~~~~~~
In file included from /home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.cpp:7:
/home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.h:46:10: note: previous specification in 'void TwoWheelRobot::backwardLeft(int)' here
46 | void backwardLeft(int segment_length = _default_segment_length);
| ^~~~~~~~~~~~
/home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.cpp:125:6: error: default argument given for parameter 1 of 'void TwoWheelRobot::forwardLeft(int)'
125 | void TwoWheelRobot::forwardLeft(int segment_length = _default_segment_length)
| ^~~~~~~~~~~~~
In file included from /home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.cpp:7:
/home/pusky/Arduino/libraries/TwoWheelRobot/src/TwoWheelRobot.h:45:10: note: previous specification in 'void TwoWheelRobot::forwardLeft(int)' here
45 | void forwardLeft(int segment_length = _default_segment_length);
| ^~~~~~~~~~~
exit status 1
Error compiling for board Adafruit Feather M0.
pusky
Posts: 29 Joined: Sun Mar 17, 2013 12:09 pm
Post
by pusky » Sun Dec 05, 2021 11:28 am
not sure if PlatformIO and Arduino IDE use the same compilers tools, but I just tried using PlatformIO and same errors.
Code: Select all
src\TwoWheelRobot.cpp:62:6: error: default argument given for parameter 1 of 'void TwoWheelRobot::forward(int)'
62 | void TwoWheelRobot::forward(int segment_length = _default_segment_length)
| ^~~~~~~~~~~~~
In file included from src\TwoWheelRobot.cpp:7:
include/TwoWheelRobot.h:41:10: note: previous specification in 'void TwoWheelRobot::forward(int)' here
41 | void forward(int segment_length = _default_segment_length);
| ^~~~~~~
src\TwoWheelRobot.cpp:71:6: error: default argument given for parameter 1 of 'void TwoWheelRobot::backward(int)'
71 | void TwoWheelRobot::backward(int segment_length = _default_segment_length)
| ^~~~~~~~~~~~~
In file included from src\TwoWheelRobot.cpp:7:
include/TwoWheelRobot.h:42:10: note: previous specification in 'void TwoWheelRobot::backward(int)' here
42 | void backward(int segment_length = _default_segment_length);
| ^~~~~~~~
src\TwoWheelRobot.cpp:80:6: error: default argument given for parameter 1 of 'void TwoWheelRobot::right(int)'
80 | void TwoWheelRobot::right(int segment_length = _default_segment_length)
| ^~~~~~~~~~~~~
In file included from src\TwoWheelRobot.cpp:7:
include/TwoWheelRobot.h:44:10: note: previous specification in 'void TwoWheelRobot::right(int)' here
44 | void right(int segment_length = _default_segment_length);
| ^~~~~
src\TwoWheelRobot.cpp:89:6: error: default argument given for parameter 1 of 'void TwoWheelRobot::left(int)'
89 | void TwoWheelRobot::left(int segment_length = _default_segment_length)
| ^~~~~~~~~~~~~
In file included from src\TwoWheelRobot.cpp:7:
include/TwoWheelRobot.h:43:10: note: previous specification in 'void TwoWheelRobot::left(int)' here
43 | void left(int segment_length = _default_segment_length);
| ^~~~
src\TwoWheelRobot.cpp:98:6: error: default argument given for parameter 1 of 'void TwoWheelRobot::backwardRight(int)'
98 | void TwoWheelRobot::backwardRight(int segment_length = _default_segment_length)
| ^~~~~~~~~~~~~
In file included from src\TwoWheelRobot.cpp:7:
include/TwoWheelRobot.h:48:10: note: previous specification in 'void TwoWheelRobot::backwardRight(int)' here
48 | void backwardRight(int segment_length = _default_segment_length);
| ^~~~~~~~~~~~~
Compiling .pio\build\adafruit_feather_m0\lib2e5\Adafruit_TinyUSB_Arduino\arduino\Adafruit_USBD_Device.cpp.o
src\TwoWheelRobot.cpp:107:6: error: default argument given for parameter 1 of 'void TwoWheelRobot::forwardRight(int)'
107 | void TwoWheelRobot::forwardRight(int segment_length = _default_segment_length)
| ^~~~~~~~~~~~~
In file included from src\TwoWheelRobot.cpp:7:
include/TwoWheelRobot.h:47:10: note: previous specification in 'void TwoWheelRobot::forwardRight(int)' here
47 | void forwardRight(int segment_length = _default_segment_length);
| ^~~~~~~~~~~~
Compiling .pio\build\adafruit_feather_m0\lib2e5\Adafruit_TinyUSB_Arduino\arduino\hid\Adafruit_USBD_HID.cpp.o
src\TwoWheelRobot.cpp:116:6: error: default argument given for parameter 1 of 'void TwoWheelRobot::backwardLeft(int)'
116 | void TwoWheelRobot::backwardLeft(int segment_length = _default_segment_length)
| ^~~~~~~~~~~~~
In file included from src\TwoWheelRobot.cpp:7:
include/TwoWheelRobot.h:46:10: note: previous specification in 'void TwoWheelRobot::backwardLeft(int)' here
46 | void backwardLeft(int segment_length = _default_segment_length);
| ^~~~~~~~~~~~
src\TwoWheelRobot.cpp:125:6: error: default argument given for parameter 1 of 'void TwoWheelRobot::forwardLeft(int)'
Compiling .pio\build\adafruit_feather_m0\lib2e5\Adafruit_TinyUSB_Arduino\arduino\midi\Adafruit_USBD_MIDI.cpp.o
125 | void TwoWheelRobot::forwardLeft(int segment_length = _default_segment_length)
| ^~~~~~~~~~~~~
In file included from src\TwoWheelRobot.cpp:7:
Compiling .pio\build\adafruit_feather_m0\lib2e5\Adafruit_TinyUSB_Arduino\arduino\msc\Adafruit_USBD_MSC.cpp.o
include/TwoWheelRobot.h:45:10: note: previous specification in 'void TwoWheelRobot::forwardLeft(int)' here
45 | void forwardLeft(int segment_length = _default_segment_length);
| ^~~~~~~~~~~
Compiling .pio\build\adafruit_feather_m0\lib2e5\Adafruit_TinyUSB_Arduino\arduino\ports\esp32\Adafruit_TinyUSB_esp32.cpp.o
*** [.pio\build\adafruit_feather_m0\src\TwoWheelRobot.cpp.o] Error 1
not sure what to do next??
cheers,
adafruit_support_mike
Posts: 67485 Joined: Thu Feb 11, 2010 2:51 pm
Post
by adafruit_support_mike » Sun Dec 05, 2021 11:44 pm
Yep.. the code from that project is declaring default parameter values in the header declarations and in the function definitions. Those should only be in the header.
pusky
Posts: 29 Joined: Sun Mar 17, 2013 12:09 pm
Post
by pusky » Mon Dec 06, 2021 8:27 pm
Thank you worked great,
Had to change the #include <TwoWheelRobot.h> to #include "TwoWheelRobot.h" in the sketch.
Reason is I did not change the code in the library but copied the .cpp and .h into the sketch folder and updated source code there..
thank you for your assistance,
cheers,
Pasquale
Please be positive and constructive with your questions and comments.