Page 1 of 2

Need help with Teensy 3.6, Blink2 compile error

Posted: Sun Feb 25, 2018 7:03 pm
by green
Hello,
I am new to MLP. I figured I would start with Blink2 to get me going. But as always things, in the computer world never go for me as the directions say they will. When I load the Blink2 example and try to load it to my board it hangs up right off the bat in the compile step.
I have tried to attach the error page in different formats and every time it says it has the wrong extention. So I cut and pasted the error. Please if someone can help me I would appreiciate it.
Thanks,
John

Blink2: In function 'void setup()':
Blink2:54: error: no matching function for call to 'AddVariable(const __FlashStringHelper*, int&)'
SerialCommandHandler.AddVariable(F("OnTime"), OnTime);

^

In file included from C:\Users\John\Documents\Arduino\libraries\MegunoLink/CommandHandler.h:6:0,

from C:\Users\John\AppData\Local\Temp\arduino_modified_sketch_518277\Blink2.ino:36:

C:\Users\John\Documents\Arduino\libraries\MegunoLink/utility/CommandDispatcherBase.h:44:10: note: candidate: bool MLP::CommandDispatcherBase::AddVariable(const __FlashStringHelper*, uint8_t&) <near match>

bool AddVariable(const __FlashStringHelper *pName, uint8_t &rVariable);

^

C:\Users\John\Documents\Arduino\libraries\MegunoLink/utility/CommandDispatcherBase.h:44:10: note: conversion of argument 2 would be ill-formed:

Blink2:54: error: invalid initialization of non-const reference of type 'uint8_t& {aka unsigned char&}' from an rvalue of type 'uint8_t {aka unsigned char}'

Re: Need help with Blink2 compile error

Posted: Sun Feb 25, 2018 7:40 pm
by philr
Hi, I just had a go here and it seemed to compile fine for the uno, leonardo and yun types. What kind of hardware are you building it for? Do you have the latest version of MegunoLink and the Arduino library installed?

Cheers
Phil

Re: Need help with Blink2 compile error

Posted: Sun Feb 25, 2018 7:41 pm
by philr
Also, did you modify the example at all?

Re: Need help with Blink2 compile error

Posted: Sun Feb 25, 2018 8:00 pm
by green
Hi Phil,
No mods to the program.
I think I have the latest libraries, but how would I verify that?
I am using a Teensy 3.6, I can load other programs and they work, but the examples from Megunolink do not get past this error.

Blink2: In function 'void setup()':
Blink2:60: error: no matching function for call to 'AddVariable(const __FlashStringHelper*, int&)'
SerialCommandHandler.AddVariable(F("OnTime"), OnTime);

Thanks,
John

Re: Need help with Blink2 compile error

Posted: Sun Feb 25, 2018 9:09 pm
by green
Hi Phil,
I just tried the TurnLEDOFFandON and it works. :D

I don't know why, but I will keep going for now.

Thank you,
John

Re: Need help with Blink2 compile error

Posted: Wed Feb 28, 2018 2:17 am
by green
Phil,

I tried using my arduino DUE and it works fine but the Teensy 3.6 doesn't.

If I add // to the two lines SerialCommandHandler.AddVariable(F("OnTime"), OnTime);
and SerialCommandHandler.AddVariable(F("OffTime"), OffTime); lines it compiles and uploads, of course it doesn't run the program correctly though.

The teensy works with other programs just not the one with this AddVariable command.

Any ideas?

Re: Need help with Blink2 compile error

Posted: Fri Mar 02, 2018 9:15 am
by philr
Hi, im not sure why its not working on the teensy but will investigate further. In the short term i suggest you work with the commandhandler using the addcommand verison which seems to work on the teensy (at least here it does).

The best example to base it on is the SetParameters.ino example. It lets you configure a variable using a slightly different approach which seems to build.

Will update further as we try to fix it.

Cheers
Phil

Re: Need help with Blink2 compile error

Posted: Fri Mar 02, 2018 9:46 am
by philr
Turns out it is a type problem again.

Change OnTime and OffTime to int16_t rather than int and it should build fine.

Cheers
Phil

Re: Need help with Blink2 compile error

Posted: Thu Mar 22, 2018 10:50 pm
by green
That worked ! Thanks Phil

Re: Need help with Teensy 3.6, Blink2 compile error

Posted: Sat May 05, 2018 6:48 am
by smithassignment1
How to resolve it.. I tried but the error comes up again and again. Please provide me a step wise process.