1

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);
}

migrated from electronics.stackexchange.com Jun 13 '15 at 17:07

This question came from our site for electronics and electrical engineering professionals, students, and enthusiasts.

  • 1
    You're sending non-ASCII data. – Ignacio Vazquez-Abrams Jun 13 '15 at 16:59
  • 1
    Or a wrong Baud rate is set. – Eugene Sh. Jun 13 '15 at 17:04
  • 1
    This code is not sending anything through the serial port. – Edgar Bonet Jun 13 '15 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. – Vladimir Cravero Jun 13 '15 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... – jfpoilpret Jun 14 '15 at 7:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.