Displaying Decimals on 4/7 LED module

Hi all,

this is my first post so i hope i get the forum protocol right...apologies if not.

I'm a very newbie trying to learn Arduinology and have sketched the attached code to monitor an irrigation controller based on a Nano.

The code compiles and works well but wont display decimal points on a TM1737 4 digit/7 segment LED module.

Even though the Serial shows a value for 'offDelay' of say 2.50, the LED displays 2 (or 25 if x10) so i know the 2.5 value can potentially be read at the LED.

Is this just because of some minor formatting option i haven't set up?

Thanks in advance for any constructive help.

Tipping_Rain_gauge7.ino.ino (13.2 KB)

Hi and welcome.

You will get more help more quickly if you post your pictures and code in-line with the post, and include a schematic. Many of the experts on the forum may be using smartphones or tablets which don't make viewing attachments easy.

However, you may already have found that your code is too long to post, the forum won't allow more than 5000 characters. But even if it did, who will want to read all that code in order to help you? Better to cut out all extraneous parts so your sketch is reduced to a test sketch which is just enough to demonstrate the problem.

Glancing through your code, i noted a couple of concerns. How often is the EEPROM written to? Did you realise that it has limited write-cycles? If you write to it frequently, it will wear out and stop working. Around 100,000 writes i think. Secondly, the function that writes a number to the display takes an integer parameter, so no decimal places allowed. If you store the value as 10x the true value, you can hold one decimal place. The code seems to allow the decimal point to be lit if you set bit 7 in the value (=0x80).

Paul

Thanks Paul,

Very valuable feedback, i will try to cut out the extra lines and repost.

The EEPROM shouldn't be a problem with possibly around 10 writes per day although i am sure there would be a much more elegant/logical way of doing it. As you have picked up, i am very new to coding and I used EEPROM purely because it is a simple way to achieve the outcome until i get more experience. (and yes, I've been told not to run before i can walk .)

I'll test out your last suggestion and see if that fixes the lack of decimal point.