GPS Speedometer Project


I am doing a GPS Speedometer Project for my old car.

Arduino Uno
X27.168 stepper motor
1.3 inch Oled
Beitian BN-880Q GPS

I have got the speeometer to show the correct value ( both with GPS and pulses )
My proble is that I dont get the TotalDistance shown in the display.
It only states= km nan
I know that this stands for “not a number”
But I have gone through the code and can find where the problem is?
The code is not mine, have just modified it from Mph to Kmph.
I have tryed the original sketch with mph but the same issue.

If someone could spot the problem?
Have attached the code.
Thanks in advance!


instrument_v4.ino (10.3 KB)

#define INDEX_CONFIGURATION_VAR1 0 // Array used to store tenths of a mile reading
#define INDEX_CONFIGURATION_VAR2 1 // Array used to store miles

There are 2 EEPROM addresses where data is stored to and loaded from in the code


TotalDistance goes into EEPROM 0

 EEPROMwl.put(INDEX_CONFIGURATION_VAR2, PulsesPerKilometer);

PulsesPerKilometer goes into EEPROM 1

Does the EEPROMWearLevel library deal with the fact that the code appears to put a float into a single byte ?