I connected an ArduiMU v3+ via a FTDI-cable to my Mac (OS X 10.10) (latest VC FTDI driver is installed and loaded).
Inside the Arduino-software the Serial Monitor (monitoring /dev/cu.usbserial-AJ038NZ3) shows a lot of weird ASCII characters. What could be the reason for this problem?
enter image description here
Here's part of the code I uploaded to the ArduiMu:
void setup() {
// Init Serial for use by Send.cpp and Receive.cpp
Serial.begin(115200);
}
void loop() {
Receive::doTasks();
}
void Send::flexSensorData() {
char packet[64];
int packetLength = 0;
IntUnion intUnion;
FlexSensors::read(); // read sensors before sending
#ifdef BINARY_PACKETS
packet[packetLength++] = 'F';
intUnion.intVal= (int)FlexSensors::channel[0];
packet[packetLength++] = intUnion.msb;
packet[packetLength++] = intUnion.lsb;
intUnion.intVal= (int)FlexSensors::channel[1];
packet[packetLength++] = intUnion.msb;
packet[packetLength++] = intUnion.lsb;
intUnion.intVal= (int)FlexSensors::channel[2];
packet[packetLength++] = intUnion.msb;
packet[packetLength++] = intUnion.lsb;
intUnion.intVal= (int)FlexSensors::channel[3];
packet[packetLength++] = intUnion.msb;
packet[packetLength++] = intUnion.lsb;
intUnion.intVal= (int)FlexSensors::channel[4];
packet[packetLength++] = intUnion.msb;
packet[packetLength++] = intUnion.lsb;
intUnion.intVal= (int)FlexSensors::channel[5];
packet[packetLength++] = intUnion.msb;
packet[packetLength++] = intUnion.lsb;
packet[packetLength++] = calcChecksum(packet, packetLength);
#else
packet[packetLength++] = 'F';
packet[packetLength++] = ',';
IntValToChars(packet, &packetLength, (int)FlexSensors::channel[0]);
packet[packetLength++] = ',';
IntValToChars(packet, &packetLength, (int)FlexSensors::channel[1]);
packet[packetLength++] = ',';
IntValToChars(packet, &packetLength, (int)FlexSensors::channel[2]);
packet[packetLength++] = ',';
IntValToChars(packet, &packetLength, (int)FlexSensors::channel[3]);
packet[packetLength++] = ',';
IntValToChars(packet, &packetLength, (int)FlexSensors::channel[4]);
packet[packetLength++] = ',';
IntValToChars(packet, &packetLength, (int)FlexSensors::channel[5]);
packet[packetLength++] = ',';
IntValToChars(packet, &packetLength, calcChecksum(packet, packetLength));
packet[packetLength++] = '\r';
#endif
Serial.write((uint8_t*)packet, packetLength);
}
VE7JRO
2,51519 gold badges27 silver badges29 bronze badges
asked Jun 13, 2015 at 16:57
Send::flexSensorData()
is called. Also, since your code includes conditional compilation, you should indicate the value ofBINARY_PACKETS
so we don't try to guess it from your code...