Which 7-Segment dispaly and a library do support decimal fractures?

Hi there. Can anyone please point me to a particular 7-segment LED display (a driver IC) and a library for that which would be able to display properly digits with a decimal point obtained from a serial port data? I've tried all the existing libraries for both MAX7219 and 74HC595 shift register displays but none of them is capable to depict decimal fractions at all. What they do is they just show the integer part of the value read and that's it. There is no such a problem with LCD character displays though.

Thanks, Ross.

What data type is being used and passed to the display library?

Most 7-segment displays can light up any combination of decimal points but most libraries don't make it as easy as sending a 'float' to a function. You may have to modify or bypass parts of whatever library drives your display.

This library will print a float: https://github.com/adafruit/Adafruit_LED_Backpack

    @brief  Print double-precision float value to 7-segment display.
    @param  n       Numeric value.
    @param  digits  Fractional-part digits.
  void print(double n, int digits = 2);

econjack: What data type is being used and passed to the display library?

I just want to send values obtained from GPS receiver as a text stings to a display.

aarg: This library will print a float

Thanks mate! I guess that's exactly what I've been looking for. Cheers!

Try this tutorial:
Write sketch to show the temperature signal of the LM35 sensor at 2-sec interval on the display unit of the Fig-1 using Library Functions/Methods. The prototypes and meanings of the methods could be found in the attached Library file (SevSeg-master.zip). Extract the zip file and then get the syntax rules and meaning of the methods. (You may take take help of the given sketch).


#include "SevSeg.h"
SevSeg sevseg;
byte numDigits = 4;
byte digitPins[] = {A0, A1, A2, A3};//DP0, DP1, DP2, DP3
byte segmentPins[] = {8, 9, 10, 11, 12, 13, 6, 7};//a, b, c, ..., g, p from left
bool resistorsOnSegments = false;
byte hardwareConfig = COMMON_CATHODE;

void setup()
  sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments);

void loop()
  unsigned long prMillis = millis();
  while (millis() - prMillis < 2000)//temp refreshed at 2-sec interval

  float temp = 100 * ( 1.1 / 1023) * analogRead(A4);//31.76
  sevseg.setNumber(temp, 2);//decimal before 2-digit from right

SevSeg-master.zip (20.7 KB)

ccpm120: I've tried all the existing libraries for both MAX7219

Really? I only know of one, and I'm sure it has dp.


my MAX7219 library inherits from print class and can print floats like you are used to from Serial or LCD https://werner.rothschopf.net/201904_arduino_ledcontrol_max7219.htm