Skip to content

Example sketch won't compile, "default argument given for parameter 2" #2

@mantonakakis1

Description

@mantonakakis1

Example 1 sketch won't compile, I get the following error message(s):

Arduino: 1.8.8 (Windows 10), Board: "SparkFun SAMD21 Pro RF"

C:\Users\Mike\Documents\Arduino\libraries\SparkFun_Qwiic_OpenLog\src\SparkFun_Qwiic_OpenLog_Arduino_Library.cpp:274:73: error: default argument given for parameter 2 of 'boolean OpenLog::sendCommand(uint8_t, String) [-fpermissive]

boolean OpenLog::sendCommand(uint8_t registerNumber, String option1 = "")

In file included from C:\Users\Mike\Documents\Arduino\libraries\SparkFun_Qwiic_OpenLog\src\SparkFun_Qwiic_OpenLog_Arduino_Library.cpp:28:0:

C:\Users\Mike\Documents\Arduino\libraries\SparkFun_Qwiic_OpenLog\src\SparkFun_Qwiic_OpenLog_Arduino_Library.h:148:13: error: after previous specification in 'boolean OpenLog::sendCommand(uint8_t, String)' [-fpermissive]

boolean sendCommand(uint8_t registerNumber, String option1 = "");

exit status 1
Error compiling for board SparkFun SAMD21 Pro RF.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

If I remove the default argument from the sendCommand definition in the .cpp file, it compiles, i.e. when:
boolean OpenLog::sendCommand(uint8_t registerNumber, String option1)
replaces:
boolean OpenLog::sendCommand(uint8_t registerNumber, String option1 = "")

Using a SparkFun SAMD21 Pro RF and the SparkX qwiic OpenLog, I have another issue once the code is uploaded - the output of my .txt file on the SD card, running Example 1, looks like:
txt_file_output

This matches an issue I had with another version of the library (as of Jan 26th, 2019) when used with the same hardware - randomly missing characters in the output file, skipped new lines, although no random up arrows (raised as an issue in the github for that version of the library, here). Running the same sketch multiple times resulted in completely random point of error, i.e. sometimes a new line would come out correctly, other times it wouldn't, and would cut off in random spots. Now, with this version, I get the random up-arrows, as well as the randomly cut off lines.

Last I checked, the circa 1/26/2019 version of the library worked fine when the SparkX qwiic OpenLog was hooked up to a BlackBoard instead of the SAMD21 Pro RF.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions