Page 1 of 1

Interface Panel

Posted: Fri Jan 08, 2016 10:02 pm
by dande74
Hi,

I've got an Interface Panel with two setpoints. "sp_Amps_Lo" and "sp_Amps_Hi".
How do I send two or more values by clicking on one button? Is it possible?

I got it working with one value !btn_SetAmps [sp_Amps_Lo.Value]\r

Grete Software. Will certainly buy a license.

Regards,

-- Daniel

Re: Interface Panel

Posted: Fri Jan 08, 2016 10:25 pm
by dande74
I figured it out. Got Blink 2.0 from GitHub.

!btn_SetAmpsLo [sp_Amps_Lo.Value]\r
!btn_SetAmpsHi [sp_Amps_Hi.Value]\r

Code: Select all

#include "MegunoLink.h"
#include "CommandHandler.h"

CommandHandler<> SerialCommandHandler;

void cmd_SetAmpsLo(CommandParameter &Parameters)
{
	sp_Amps_Lo = Parameters.NextParameterAsDouble();
}

void cmd_SetAmpsHi(CommandParameter &Parameters)
{
	sp_Amps_Hi = Parameters.NextParameterAsDouble();
}

void setup()
{
	SerialCommandHandler.AddCommand(F("btn_SetAmpsLo"), cmd_SetAmpsLo);
	SerialCommandHandler.AddCommand(F("btn_SetAmpsHi"), cmd_SetAmpsHi);
}

void loop()
{
	SerialCommandHandler.Process();
	delay(250);
}

Re: Interface Panel

Posted: Wed Jan 13, 2016 7:41 am
by philr
Hi Daniel. nice work on figuring it out! Hope you enjoy MegunoLink.

Cheers
Phil