Display numbers and text simultaneously on 4 digit TM1637 4 digit 7-seg

Hi all,

Wrote a small sketch to read the temp out of a DHT11 sensor and display it on a 4 digit, 7-seg LED driven by a TM1637.

The code works and displays the temp in Fahrenheit just fine. What I’d like to do is add the letter F after the digits for the actual temp.

For example the display now shows the temp as 78. I’d like to display 78F.

I realize the call I make ‘display.showNumberDec’ is for numbers only. How to add the F?

Code:

#include <TM1637Display.h>

const int CLK = 9; //Set the CLK pin connection to the display
const int DIO = 8; //Set the DIO pin connection to the display

#include "dht.h"
 
#define dht_apin 6  //Set the input from the DHT11 to pin 6
 
dht DHT;

TM1637Display display(CLK, DIO);  //set up the 4-Digit Display. 

void setup(void) {
  display.setBrightness(0x0a);  //set the display to maximum brightness
  
}
 
void loop(void) {

  DHT.read11(dht_apin);  // Read apin on DHT11

  display.showNumberDec(DHT.temperature * 1.8 + 32); //Display the Variable value;

  delay(5000);  // 5 second delay before accessing DHT11 

}

Thank you in advance.

Take the most significant digit of your number and multiply it by 256, then to this add the least significant digit times 16 and finally add 15 to this value. Then show it with a call to display.showNumberHex.
I am guessing here that your library has such a call.

Get the most significant digit by dividing your number by 10 and the least by mod 10 ( mod is the % symbol )

It looks like you're using https://github.com/avishorp/TM1637 and thus would have to use display.setSegments to display an F with that library. I like this one: https://github.com/bremme/arduino-tm1637 because it uses the Print class to make it super easy to do things like this, if perhaps a bit less lightweight than the library you're using now.

Pert, you are correct. I am not using the bremme library. Looking at the examples that looks like it may easily solve my issue.

I’ll add the bremme library tonight and give it a try

Thank you very much.