Has anyone connected a raspberry pi to the BiBoard using the Tx,Rx, Ground, and 5v GPIO pins? I was able to run ardserial.py using the usb-c port connected to the Rpi, but didn't have any luck with GPIO.
I've gotten the serial monitor to work on both USB and UART2 with the XS command. I'm having trouble getting the IMU data to send to my raspberry pi through the "v" command though. When I enter "v" through the raspberry pi, the IMU data is printed on the arduino IDE serial monitor, but not on the PI. Do you have any insight on this?
Consider this bit of refactoring Jujutsu to resolve the problem.
The goal is to have print6Axis print to the second serial port (if not all output ports).
The issue is print6Axis formats the output using macros that are tied to the USB serial port.
We would like to separate the output formatting from the serial port. We don't want to change the macros because they're extensively used in other code. Instead we use a local buffer to hold the formatted output and then print that buffer to the appropriate ports.
void print6Axis() {
// format the output ...
auto fmt{
"%.2f\t%.2f\t%.2f\t"
"%d\t%d\t%d\t"
"%.2f"
};
char text[80 + 1]{}; // 1 line + nul
int len{
snprintf(
text
, sizeof(text) - 1
, fmt
, ypr[0], ypr[1], ypr[2]
, xyzReal[0], xyzReal[1], xyzReal[2]
, aaWorld.z
)
};
if (0 < len) {
printToAllPorts(text);
}
}
I've gotten the serial monitor to work on both USB and UART2 with the XS command. I'm having trouble getting the IMU data to send to my raspberry pi through the "v" command though. When I enter "v" through the raspberry pi, the IMU data is printed on the arduino IDE serial monitor, but not on the PI. Do you have any insight on this?