Need help with Teensy 3.6, Blink2 compile error

Support forum for MegunoLink
green
Posts: 5
Joined: Sun Feb 25, 2018 6:46 pm

Sun Feb 25, 2018 7:03 pm

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}'
Last edited by green on Thu Mar 22, 2018 11:11 pm, edited 1 time in total.
philr
Posts: 279
Joined: Mon May 26, 2014 10:58 am

Sun Feb 25, 2018 7:40 pm

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
philr
Posts: 279
Joined: Mon May 26, 2014 10:58 am

Sun Feb 25, 2018 7:41 pm

Also, did you modify the example at all?
green
Posts: 5
Joined: Sun Feb 25, 2018 6:46 pm

Sun Feb 25, 2018 8:00 pm

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
green
Posts: 5
Joined: Sun Feb 25, 2018 6:46 pm

Sun Feb 25, 2018 9:09 pm

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
green
Posts: 5
Joined: Sun Feb 25, 2018 6:46 pm

Wed Feb 28, 2018 2:17 am

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?
philr
Posts: 279
Joined: Mon May 26, 2014 10:58 am

Fri Mar 02, 2018 9:15 am

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
philr
Posts: 279
Joined: Mon May 26, 2014 10:58 am

Fri Mar 02, 2018 9:46 am

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
green
Posts: 5
Joined: Sun Feb 25, 2018 6:46 pm

Thu Mar 22, 2018 10:50 pm

That worked ! Thanks Phil
smithassignment1
Posts: 1
Joined: Sat May 05, 2018 6:44 am
Contact:

Sat May 05, 2018 6:48 am

How to resolve it.. I tried but the error comes up again and again. Please provide me a step wise process.
Get the Best Assignment Help in uk.
Post Reply