Nissan ECU logger code help!

Hello.

I have a car at the moment that I'm tuning via real time on PC based software that uses a Arduino or a DLP-08 that uses Analog or Digital inputs to send to the program in real time via USB connection.

The problem I face is I want to add 3 addressed DS18b20 sensors to measure various temperature readouts on there own pin 3-4-5 and have not a clue where to start.

I have a compiled code that was kindly made by a tuner for Arduino that I would like to use on the Arduino nano board.

I have basic Arduino knowledge and if some one could help me this it would be most appreciated.

Addresses:
DeviceAddress Probe01 = { 0x28, 0xE1, 0x53, 0xD7, 0x06, 0x00, 0x00, 0x8D };
DeviceAddress Probe02 = { 0x28, 0xB3, 0x18, 0x2F, 0x06, 0x00, 0x00, 0x39 };
DeviceAddress Probe03 = { 0x28, 0x1B, 0x75, 0xC4, 0x06, 0x00, 0x00, 0xE4 };

Arduino based code:

/* Arduino One - DLP emulation */

const int DLP_CMD_DIGITAL_IN_CH1 = 0x41;
const int DLP_CMD_DIGITAL_IN_CH2 = 0x53;    
const int DLP_CMD_DIGITAL_IN_CH3 = 0x44;    
const int DLP_CMD_DIGITAL_IN_CH4 = 0x46;    
const int DLP_CMD_DIGITAL_IN_CH5 = 0x47;    
const int DLP_CMD_DIGITAL_IN_CH6 = 0x4E;    
const int DLP_CMD_DIGITAL_IN_CH7 = 0x4A;    
const int DLP_CMD_DIGITAL_IN_CH8 = 0x4B;

const int DLP_CMD_ANALOG_IN_CH1 = 0x5A;
const int DLP_CMD_ANALOG_IN_CH2 = 0x58;
const int DLP_CMD_ANALOG_IN_CH3 = 0x43;
const int DLP_CMD_ANALOG_IN_CH4 = 0x56;
const int DLP_CMD_ANALOG_IN_CH5 = 0x42;
const int DLP_CMD_ANALOG_IN_CH6 = 0x4E;
const int DLP_CMD_ANALOG_IN_CH7 = 0x4D;
const int DLP_CMD_ANALOG_IN_CH8 = 0x2C;

const int DLP_CMD_TEMPERATURE_IN_CH1 = 0x39;
const int DLP_CMD_TEMPERATURE_IN_CH2 = 0x30;
const int DLP_CMD_TEMPERATURE_IN_CH3 = 0x2D;
const int DLP_CMD_TEMPERATURE_IN_CH4 = 0x3D;
const int DLP_CMD_TEMPERATURE_IN_CH5 = 0x4F;
const int DLP_CMD_TEMPERATURE_IN_CH6 = 0x50;
const int DLP_CMD_TEMPERATURE_IN_CH7 = 0x5B;
const int DLP_CMD_TEMPERATURE_IN_CH8 = 0x5D;

const int DLP_SETUP_FARENHEIT = 0x4C; // not used
const int DLP_SETUP_CELCIUS = 0x3B; // not used
const int DLP_SETUP_ASCII = 0x60;
const int DLP_SETUP_BINARY = 0x5C;

const int DLP_CMD_PING = 0x27;
const int DLP_RESP_PING = 0x51;

const int SET_MODE_ASCII = 0;
const int SET_MODE_BINARY = 1;

const float AD_MULTIPLIER = 5.0/1024.0;

void setup() {
  Serial.begin(115200);
  pinMode(A0,INPUT);
  pinMode(A1,INPUT);
  pinMode(A2,INPUT);
  pinMode(A3,INPUT);
  pinMode(A4,INPUT);
  pinMode(A5,INPUT);
}

int rxByte = 0;
int currMode = SET_MODE_ASCII;
int sensorValue = 0;

void loop() 
{
  if (Serial.available() > 0)
  {
     rxByte = Serial.read();
     int sendADVal = false;
     int sendTempVal = false;
     
     switch (rxByte)
     {
       case DLP_SETUP_ASCII:
         currMode = SET_MODE_ASCII;
         break;
       case DLP_SETUP_BINARY:
         currMode = SET_MODE_BINARY;
         break;
       case DLP_SETUP_FARENHEIT:
         break; // not used
       case DLP_SETUP_CELCIUS:
         break; // not used
       case DLP_CMD_PING:
         // ping response
         Serial.write(DLP_RESP_PING);
         break;
       case DLP_CMD_ANALOG_IN_CH1:
         sensorValue = analogRead(A0);
         sendADVal = true;
         break;
       case DLP_CMD_ANALOG_IN_CH2:
         sensorValue = analogRead(A1);
         sendADVal = true;
         break;
       case DLP_CMD_ANALOG_IN_CH3:
         sensorValue = analogRead(A2);
         sendADVal = true;
         break;
       case DLP_CMD_ANALOG_IN_CH4:
         sensorValue = analogRead(A3);
         sendADVal = true;
         break;
       case DLP_CMD_ANALOG_IN_CH5:
         sensorValue = analogRead(A4);
         sendADVal = true;
         break;
       case DLP_CMD_ANALOG_IN_CH6:
         sensorValue = analogRead(A5);
         sendADVal = true;
         break;
       case DLP_CMD_ANALOG_IN_CH7:
       case DLP_CMD_ANALOG_IN_CH8:
         sensorValue = 0; // not available
         sendADVal = true;
         break;
       case DLP_CMD_TEMPERATURE_IN_CH1:
       case DLP_CMD_TEMPERATURE_IN_CH2:
       case DLP_CMD_TEMPERATURE_IN_CH3:
       case DLP_CMD_TEMPERATURE_IN_CH4:       
       case DLP_CMD_TEMPERATURE_IN_CH5:       
       case DLP_CMD_TEMPERATURE_IN_CH6:       
       case DLP_CMD_TEMPERATURE_IN_CH7:       
       case DLP_CMD_TEMPERATURE_IN_CH8:       
         sensorValue = 0; // not available
         sendTempVal = true;       
         break;       
       default:
         break;
     }
     
     if (sendADVal || sendTempVal)
     {
        if (currMode == SET_MODE_BINARY)
        {
           Serial.write((char)(sensorValue >> 8));
           Serial.write((char)(sensorValue));
        }
        else
        {
           Serial.print((float)sensorValue * AD_MULTIPLIER,2);
           Serial.println("V");
        }
     }
  }
}

I have basic Arduino knowledge and if some one could help me this it would be most appreciated.

Help you with what? There are plenty of examples for reading from those sensors. They ALL connect to the same pin. Some of the examples are piss-poor, with a really stupid function that actually does the reading, but that piss-poor function can easily be renamed and fixed.

I don't understand 90% of that DLP sketch or how it uses those functions.
They are not the basic functions I deal with or even seen before.

And far enough there are examples out there they also need editing like you say.

So how and where do I put the mystery functions into this DLP sketch on there own pin.

ismellsmoke:
I don't understand 90% of that DLP sketch or how it uses those functions.
They are not the basic functions I deal with or even seen before.

And far enough there are examples out there they also need editing like you say.

So how and where do I put the mystery functions into this DLP sketch on there own pin.

It's obvious that you haven't even looked at any examples.

Sorry WHAT!!

YES I havent looked at any examples have I.

So I just made this up did I.

DeviceAddress Probe01 = { 0x28, 0xE1, 0x53, 0xD7, 0x06, 0x00, 0x00, 0x8D };
DeviceAddress Probe02 = { 0x28, 0xB3, 0x18, 0x2F, 0x06, 0x00, 0x00, 0x39 };
DeviceAddress Probe03 = { 0x28, 0x1B, 0x75, 0xC4, 0x06, 0x00, 0x00, 0xE4 };

Knob!

WHAT DONT YOU UNDERSTAND MATE!!!
Are you just here to be little people.
Where do your karma come from.

Anyone else please!

Does no one know how to help with this.
I though this was a place to learn.