Hello!
I am new to Qnimble and am trying to run a PID servo loop that communicates with a host computer running a python server via serial connection. I am having trouble writing to and reading back from the Qnimble Quarto using the qCommand library. The Quarto is currently running the following code:
#include "qCommand.h"
qCommand qC;
double loopGain = 1.021;
int anInteger;
void setup() {
qC.assignVariable("Int",&anInteger);
}
void loop() {
qC.readSerial(Serial);
qC.readSerial(Serial2);
}
and I am attempting to assign a value to the "anInteger" variable with the following python code:
data_str = "Int 5"
serial.write(data_str.encode(latin-1))
However, when I include a Serial.print(anInteger) in void loop{} and read from the Quarto with the following code:
a = self._read_until("\n")
return a
The returned value is 0. From the documentation it is unclear if it is possible to write directly to a variable with the qCommand package and python server (I am not sure how the Quarto is parsing the command and value in the same string). Any advice on how to get this working or is this functionality not yet available?