Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Teensy 3.5 and Freematics device

  1. #1
    Junior Member
    Join Date
    Mar 2021
    Posts
    3

    Teensy 3.5 and Freematics device

    I can run the exemple Code I got with the OBD library if I use a MEGA or UNO. But for a reason i don't get yet, the Arduino IDE wont compile if i choose Teensy 3.5
    the only parts that seems to not working, is the one that suppose to read the DTC

    ... this parts...


    unsigned int codes[6];
    byte dtcCount = obd.readDTC(codes, 6); // this line is over surlined
    if (dtcCount == 0) {
    mySerial.println("No DTC");
    } else {
    mySerial.print(dtcCount);
    mySerial.print(" DTC:");
    for (byte n = 0; n < dtcCount; n++) {
    mySerial.print(' ');
    mySerial.print(codes[n], HEX);
    }
    mySerial.println();
    }
    delay(5000);


    and it return me this:
    //
    no matching function for call to 'COBD::readDTC(unsigned int[6], int)'
    //

    all the other function i try with Teensy and Freematic works good but not this one
    anybody can help???
    thanks

  2. #2
    Member
    Join Date
    Aug 2018
    Location
    Brisbane, Australia
    Posts
    48
    On the teensy family, an int is 32 bits. Did you try changing the declaration of codes to uint16_t to match the hardware?

  3. #3
    Junior Member
    Join Date
    Mar 2021
    Posts
    3
    Quote Originally Posted by thebigg View Post
    On the teensy family, an int is 32 bits. Did you try changing the declaration of codes to uint16_t to match the hardware?
    no, and Im just mid-level "beginer" who really want to learn...
    you mean:
    unit16_t codes[6];

    instead of?

    unsigned int codes[6];

  4. #4
    Member
    Join Date
    Aug 2018
    Location
    Brisbane, Australia
    Posts
    48
    uint16_t not unit16_t

  5. #5
    Junior Member
    Join Date
    Mar 2021
    Posts
    3
    bad typing sorry.... but thanks already try this... it compile... nobug! will test in the car tomorrow... thanks you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •