Voor mijn energie meter zou ik graag 2 variabelen bij elkaar willen optellen, zodat ik het dagverbruik op een lcd scherm kan zetten.
Omdat hiervoor geen commando is wil ik proberen hiervoor een plugin te maken.
Mijn idee is om het volgende commando te maken:
calc <var1>, <var2>
Hierbij wordt dan de inhoud van var 2 opgeteld bij var 1 , en in var 1 geplaatst
De uitleg bij plugin_255 begrijp ik niet helemaal, maar het is me wel gelukt om iets op te tellen.
case PLUGIN_COMMAND:
{
UserVar[event->Par1 -1] = 15 + 30 ;
success=true;
break;
calc 12,13 vult nu var12 met het getal 45.
Hoe kan ik nu de inhoud van 2 variabelen bij elkaar optellen?
UserVar[event->Par1 -1] = float(UserVar[event->Par1 -1] + UserVar[event->Par1];
Bovenstaand levert niet het juiste resultaat.
Wie kan mij een beetje op weg helpen?
En zijn er nog meer zaken waar ik op moet letten.
Alvast bedankt!