You don’t need to parse the protocol manually, you can just use this library:
Hi, mah
Yesterday, I received teensy 4.0.
So, I set up and upload your code.
But It did not work including beep task.
Could check my settings?
If I change the pin each other, I could see the message in serial console. but beepTask work. motor don’t spin.
The below is output.
I change some code to check raw message.
void printMyxaMessageByteSequence( byte myxaUnescapedMsg[], int msgLength) {
if (loggingEnabled == true) {
for (int i = 0; i < msgLength; i++) {
//loggingSerialPort->write(myxaUnescapedMsg[i]);
loggingSerialPort -> print(myxaUnescapedMsg[i], HEX);
loggingSerialPort -> print(",");
}
}
}
the loop in the code is.
void loop() {
//myxa.sendMyxaBeepTask(3000, 1);
myxa.sendMyxaRunTask(MYXA_CONTROL_MODE_MECHANICAL_RPM, 500);
//only send one type of request at a time or parser won't know what to parse.
myxa.requestMyxaMessage(MYXA_GENERAL_STATUS_MESSAGE_TYPE);
//myxa.requestMyxaMessage(MYXA_TASK_STATISTICS_MESSAGE_TYPE);
//myxa.requestMyxaMessage(MYXA_DEVICE_CHARACTERISTICS_MESSAGE_TYPE);
//myxa.requestMyxaInfo();
myxa.readMyxaSerial();
}
code is working. problem is gnd.
gnd level should be the same as serial level.
in the the above picture, additionally I connect drone code probe 'gnd to teensy’s gnd.