Constantly restarts

In arduino I have placed a temperature sensor and with the reader of the arduino it marks 23.9 ° C. The needles of the Realdash marks 24 ° C, which is perfect for me. But the problem I have is that when it reaches 24 ° the needle goes down to 0 ° and the reading starts again and it stays that way continuously.


What am I missing?
or
What am I doing wrong?


XML


void setup()
{
Serial.begin(9600);
sensors.begin();
pinMode(6, OUTPUT);


void loop()
{
// Call sensors.requestTemperatures() to issue a global temperature and Requests to all devices on the bus
sensors.requestTemperatures();

Serial.print("Celsius temperature: ");
// Why “byIndex”? You can have more than one IC on the same bus. 0 refers to the first IC on the wire
Serial.print(sensors.getTempCByIndex(0));
delay(5);

Maybe the ‘Serial.print’ commands are messing up the communication between Arduino and RealDash, thus its reconnecting constantly.

That’s when I realized where I have the problem.
The ambient temperature coincided with the values ​​of the .ino sample. I changed the value of the .ino and it changed the value in the dash. The temperature sensor is working fine for me and I can read it on Arduino, but I don’t know how to connect my sensor with that command …

if (clt ++> 300)
{
clt = 0;
}

In my opinion this expression is incorrect! Since it combines a condition with a loop!

(collant++>300)
What are you trying to achieve with this expression?

Hi Cotech, that expression is placed in the arduino example on GitHub, and I don’t know what I have to do to add the temperature sensor that I made work in Arduino, do I remove that expression? or do I have to add something in the sensor order to match this expression?

I got the board to fully work with OBD2 in another car, but the design is for a 1966 Ford F100 with no electronics so I’m starting my first steps with arduino, never used it. It’s all trial and error for me, I’m googling the settings and some things I’ve already managed to make work with Realdash and some not. As is the case with the temperature sensor that I cannot link to it I modified the value in the .xml to match the scale of the needles, but then I realized that it was not reading the values ​​from my sensor, the Realdash was reading That order that I have placed above, that’s why I stay here, I don’t know if I have to remove that or somehow couple it to the code that reads the temperature in Arduino …

This part simulates the value of CLT
To assign an analogy entry, you need to do something like:

clt = analogRead (analogPin);

Hello Celso, thanks for the tip.
what should I do? remove the
si (clt ++> 300)
{
clt = 0;
}
command and place what you put above?

clt = analogRead (analogPin);

and below that order I place the input pin?

I consult this. because I made that request and it didn’t work for me.
There is something that I am misplacing or I am not doing it right.
The input I am using is analog 4.

Thanks for your time!!
Hug

try:

clt = analogRead (A0);