2

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
9
  • 1
    You're sending non-ASCII data. Commented Jun 13, 2015 at 16:59
  • 1
    Or a wrong Baud rate is set. Commented Jun 13, 2015 at 17:04
  • 1
    This code is not sending anything through the serial port. Commented Jun 13, 2015 at 20:11
  • 1
    As already said, you are sending binary data so what you receive is (probably) right. Try to send "Hello world" and see if it works. Commented Jun 13, 2015 at 20:57
  • 1
    The code you posted is incomplete; there is no evidence here that Send::flexSensorData() is called. Also, since your code includes conditional compilation, you should indicate the value of BINARY_PACKETS so we don't try to guess it from your code... Commented Jun 14, 2015 at 7:11

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.