OBD II Bike Connector - Pass via bluetooth

As I wrote, I already got a function for that. But with hardcoded values.
The gear ratios are very close to each other, so it might jump around, having a "learning"-function. At least for gear 4, 5 and 6.

Looks like that:

uint8_t GetCurrentGear() {
  //Neutral or Engine off
  if (data.Speed == 0 || data.Speed == 0xFF || data.RPM[0] == 0xFF || data.RPM[1] == 0xFF)
    return 0;

  uint16_t rpm = data.RPM[0] * 64; //*256 / 4
  if (data.RPM[1] >= 4)
    rpm += data.RPM[1] / 4;
  uint8_t ratio = rpm / data.Speed;

    case 130 ... 180:
      return 1;
    case  88 ... 120:
      return 2;
    case  70 ... 80:
      return 3;
    case  60 ... 69:
      return 4;
    case  55 ... 59:
      return 5;
    case  48 ... 54:
      return 6;
      //If ratio not exact and bike not rolling out, return last valid gear
      if(data.Speed > 20 && rpm > 2000)
        return data.TransmissionGear;
      return 0;

And works quite well :+1:t2:

The PID list is quite long, and there is a lot inside. Also engine runtime and all kind of errors. Would be cool on that display as well!

At this moment I'm exporting the arduino code to my ARM microcontroller language.
It isn't an easy work when you are not a programmer but I'll get it!

I send the FastInit sequence and I can see the hex frame " 81 11 F2 81 05" in the COM terminal.
I run the ECU Emulator project (it's my first time with Visual Studio) and click on the Connect button.
I suppose the Init box should be automatically clicked when my board sends the correct sequence, is that correct?
Should I do anything else?


The ECU-Emulator does not care about the FastInit-sequence. Because it´s only on-off, but serial waits for real data.
So the "init" checkbox will be set after receiving the start communication (0x81) and start diagnostic (0x10 0x80).

Currently I´m reworking some of the documentation, code and also the emulator. It will take some time, but I´ll publish a new Git at the and of this year, I think.