DHT22 sensor and Seven Segment display

I’m using the SevenSeg.h lib for 7 seg display and the DHT.h (by adafrut) lib for a DHT22 sensonsor,
and I want to display the value on a 7 seg display(code bellow), now I should mention that I’m new to programing. It works but there is a flicker on display at about 3s. I tried using the setRefreshRate in order to solve these but I had no luck. Can you please point me to what I’ve made wrong?
Have a nice day!

#include <SevenSeg.h>

#include <DHT.h>
#define DHTPIN 13 // Pin D13 used as DHT Input
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321

SevenSeg disp(2, 3, 4, 5, 6, 7, 8); //Asigne A,B,C,D,E,F,G to uC
const int numOfDigits = 4; //Declare nr od Digits
int digitPins[numOfDigits] = {9, 10, 11, 12};//Map Digits
int DPPin = A0; //Map Decimal Point
int pushButt1 = A1; //Map Pin for push button In
int pushButt1State = 0; //Push But state to be used
int freq = 150;
void setDPPin(int DPPin); //Use of Decimal Point Fc
void setRefreshRate(long int freg);

void setup() {

pinMode(DPPin, OUTPUT);
pinMode(pushButt1, INPUT);
disp.setDigitPins(numOfDigits, digitPins);


void loop() {

float t = dht.readTemperature();
float h = dht.readHumidity();

pushButt1State = digitalRead(pushButt1);
if (pushButt1State == HIGH)




How long does the sensor take to take each reading ? I am not familiar with it but seem to remember that it needs some time but I could easily be wrong.

Why the


The loop() function does a good job of looping all on its own.

Comments Why did you not put your code in code tags when posting as advised in read this before posting a programming question It stops the forum software mangling text. Look at the code in your post. Does it really have a smiley in it ?

Please use the Auto Format tool in the IDE to tidy up your code indenting to make it easier to read.