For any add-on boards such as VR conditioners, optos and OEM interface boards
By The_Boss
#29200
Hi i am building a dash for my R1 how do i convert ie o2 147 to 14.70 for my nextion i can read the val and print on lcd but want to get 14.70 not 147 :D please help thanx
By dazq
#29203
With the value saved in a float variable, if you divide by 10 then the variable should now hold 14.7 or is that not what you meant?
By dazq
#29207
Ah I see, I have this fun to come yet :-)
Did the other chap in the nextion thread manage to do it?

I thought it was an odd request :-)
By NickZ
#29208
i think so, it is possible just need extra code and ive been too lazy to search it up. My dash is all up and working but im having trouble with one of my cars, so thats taking all my time.
It would be great to get the serial on the teensy working so i can use my dash on my current project:)
By ric355
#29210
The_Boss wrote: Thu Sep 27, 2018 7:00 am Hi i am building a dash for my R1 how do i convert ie o2 147 to 14.70 for my nextion i can read the val and print on lcd but want to get 14.70 not 147 :D please help thanx
If, as NickZ says, the Nextion doesn't like displaying floating point numbers then the solution is probably to convert the number to a string and then use a text field instead of a numeric field on the display. I know nothing about this device as I've never used it but that would be what I'd try if it doesn't like handling floating point numbers.
By The_Boss
#29212
Thanx all will keep trying i am not a coder at all but copy and paste help alot :D
By NickZ
#29224
Yes thats it, convert to a string and use a text field, i did try this some time ago but couldn't work it out.
By dazq
#29226
i have been trying that issue on the simulator and this works ok.
use this in your arduino code

Serial2.print("afr.txt=");
Serial2.write(0x22);
Serial2.print(afr/10.0);
Serial2.write(0x22);
Serial2.write(0xff);
Serial2.write(0xff);
Serial2.write(0xff);

make the afr object a text object. for example a afr value of 147 this will show 14.7

What is in the stock ECU? some of them don't use a[…]

Jeep transmission compatibility

Wanting to replace the old crappy Chrysler PCM in […]

blitzbox

Hi, It seems I can’t blame the error with t[…]

Thank you all for your input. I have managed to g[…]

Still can't find what you're looking for?