I am looking for some advice. I bought a Uno and a 2.8" Nextion display for a project. I want to build a custom monitoring display for a classic car where the display will replace an ash tray in the dash board. I want to display Temperature, Oil Pressure, Oil Temp, Transmission Temp and RPM. I have designed the interface circuits to enable this to work with the Arduino IO. I will also include a GPS module so I can display KPH as the cars speedometer reads in MPH. The 2.8" display will allow a custom 3D printed adapter/bezel to be made to integrate the display into the available space.
Problem is the amount of memory available on the display. I have drawn custom gauges to match those of the vehicles instruments. I have a graphical image for with a needle for 80 steps across each display. Because the Nextion must use .bmp graphic files, the memory is not big enough for 1 gauge let alone all of those I would like to be able to display. I know I can simply display the values as numerical objects, but I was hoping for the gauges. If the Nextion could work with JPEG files it would save a heap of memory, but it only works with bitmaps.
From my research, is doesn't appear there is any other way other than perhaps going to a Mega and a different display. Can anyone suggest the best display, ideally 2.8" or no bigger than 85x60mm.
You haven't said exactly what Nextion display you have - it has a different built-in memory.
The Nextion editor works with JPG, BMP and PNG files.
Why? If I understand correctly you have 80 different pictures. Can't you just use a single background image and programmatically draw the arrow on it in a certain position? The size of BMP files depends exactly on the number of the pixels and how many colors or bits are used for each pixel. If you use 24 bit color and just reduce them to 256 or even 16 colors the file will be much smaller. It might be possible to save the images to a micro SD memory card and have the Arduino read them from there. I guess an Arduino Nano (it's similar to an Uno but smaller and has 2 more analog inputs) will do the trick.
If the images don't overlap then consider using a single background with all the images in the background. You then use cropped images to show or hide the bit you want to see / not see.
If that doesn't work then as @flashko suggests use the Nextion instructions to draw the arrow. I suggest you write the code to draw the arrow on the Nextion itself, put the code behind a button and send a click pressed event followed by a click not pressed event to trigger the drawing. You can hide a button by making it 2 pixels square, making it the same colour at the background and putting it on the display out of the way, for example in a corner.
This code on one of my displays:
n.val=11
y.val=70
for(i.val=0;i.val<n.val;i.val++)
{
line 65,y.val,737,y.val,61215 //Gray with a little bit of blue to contrast the yellow trace
y.val=y.val+25
}
n.val=8
x.val=65
for(i.val=0;i.val<n.val;i.val++)
{
line x.val,70,x.val,320,61215
x.val=x.val+96
}
Draws a grid. It is as a touch release event behind a hidden button.
Thanks for your suggestions and sorry for my slow reply. My son has been home from Canada and we have been kept busy with him. I'll look into the suggestions and see how I go.