sending values to Gauge
Posted: Sun Jan 29, 2023 12:01 pm
When I try to send data to the Gauge I keep having the message AddCommand: full. When I directly send a number in the Arduino sketch it works fine but when I attach a variable it doesn't work. Does anybody knows what I am doing wrong?
Above the part of my code that should send the value rpm to Megunolink. rpm is a integer. I hope someone knows what I am doing wrong.
Code: Select all
void loop() {
SerialCmds.Process(); //Monitor serial commands
if (timeOut(250)) { // 4 Hz update frequency
cli(); //stop interrupts
prevPulseUsCopy = prevPulseUs;
pulseUsCopy = pulseUs;
sei(); //allow interrupts
pulsePeriod = pulseUsCopy - prevPulseUsCopy;
if (pulsePeriod) rpm = 20 + slotUs / pulsePeriod ;
Serial.println(rpm);
SerialCmds.AddCommand(F("GetSpeed"),Cmd_SendSpeedRightMotor);
}
}
void Cmd_SendSpeedRightMotor(CommandParameter& p)
{
InterfacePanel MyPanel;
// Set control value
MyPanel.SetNumber(F("IPGauge2"), rpm);
}