Page 1 of 1

Nextion dash

Posted: Thu Jul 09, 2020 9:37 pm
by Peter
Hi Forum. Just thought to show my Nextion 7” dash. All functioning and updated by Arduino reading CAN from CombiV8 and Olimex.

Re: Nextion dash

Posted: Fri Jul 10, 2020 6:09 am
by sfk
Peter wrote: Thu Jul 09, 2020 9:37 pm Hi Forum. Just thought to show my Nextion 7” dash. All functioning and updated by Arduino reading CAN from CombiV8 and Olimex.
Looks good. I am messing around with some of these displays but because I don't have a drivetrain yet it's all just UI graphics.

Re: Nextion dash

Posted: Fri Jul 10, 2020 10:34 am
by JaniK
Nice project :)

Re: Nextion dash

Posted: Fri Jul 10, 2020 7:48 pm
by Peter
Thanks for your comments. Was a bit of a challenge initially but got there in the end. If you need any help with sorting one I am happy to do as much as I can. Peter

Re: Nextion dash

Posted: Fri Jul 10, 2020 7:50 pm
by zippy500
nice work, is there a lot of coding involved ?

Re: Nextion dash

Posted: Sat Jul 11, 2020 12:39 pm
by Peter
Hi zippy500. As far as the Nextion screen is involved that’s not too bad. Arduino code is not bad too so once you have done a simple gauge it’s just a matter of tweaking the code. For instance the gauge needle is in degrees so using ‘map’ you can set values to degrees. Example myRPM = map(RPM, 0, 9000, 0, 360) angle depends on how you have oriented your gauge.

Re: Nextion dash

Posted: Sat Jul 11, 2020 1:22 pm
by Peter
Here is my code used for the RPM gauge on my dash.
Not sure why I cant upload files with 'ino' extension so have copied and pasted, sorry.

Code: Select all

// Motor RPM 
    if (RPM < 3700)
      {getRPM = map(RPM, 0, 3700, 270, 360);} // Angle is to allow needle to start at 6 o'clock position

    if (RPM > 3700)
      {getRPM = map(RPM, 3700, 9000, 0, 130);} // Angle for above 3700 RPM starts at 9 o'clock position
    
    if (getRPM == oldRPM)
    {;}
    else
   {oldRPM = getRPM;
    Serial.print("z2.val=");
    Serial.print(getRPM); // getRPM value is in degrees
    Serial.write(0xff);   // You must send Serial code three times
    Serial.write(0xff);   
    Serial.write(0xff);
  
    if (RPM >-5) {RPMNeedle = 2024;} // RPMNeedle value selects colour
    if (RPM >6500) {RPMNeedle = 63488;}
    Serial.print("z2.pco=");
    Serial.print(RPMNeedle);
    Serial.write(0xff);
    Serial.write(0xff);
    Serial.write(0xff);}

Re: Nextion dash

Posted: Sat Jul 11, 2020 3:56 pm
by joromy
Peter wrote: Sat Jul 11, 2020 1:22 pm Here is my code used for the RPM gauge on my dash.
Not sure why I cant upload files with 'ino' extension so have copied and pasted, sorry.
Use code button ( </> ) when adding code, and maybe type of code (C++ Arduiono Nextion...)

Code: Select all

1 print "Hello"
2 goto 1
And edit your post :)

Re: Nextion dash

Posted: Sat Jul 11, 2020 5:44 pm
by Peter
Thanks joromy. Done to your specification :-)

Re: Nextion dash

Posted: Tue Aug 11, 2020 10:03 pm
by SciroccoEV
Do you think it's got enough brightness/contrast for main display vehicle use? Many displays are completely washed out by a bit of sunlight.