title: How to display the variable in a seven segment LED?
body: <p>My question is, how to display the variable in a seven segment LED? I want to refresh the display every two seconds, however if I execute like the code below, it does not display properly. Any solutions?</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include "SevSeg.h"
  int reading;
  int tempPin = 0;
  float tempC;
  unsigned long StartTime = millis();
  SevSeg sevseg; //Initiate a seven segment controller object
  
  void setup() {
      analogReference(INTERNAL);
      Serial.begin(9600);
      byte numDigits = 4;
      byte digitPins[] = {2, 3, 4, 5};
      byte segmentPins[] = {6, 7, 8, 9, 10, 11, 12, 13};
      sevseg.begin(COMMON_ANODE, numDigits, digitPins, segmentPins);
      sevseg.setBrightness(90);
  }
  
  void loop() {
      unsigned long CurrentTime = millis();
      unsigned long ElapsedTime = CurrentTime - StartTime;
      if(ElapsedTime &gt; 2000) {
          tempC = tempRequest();
          sevseg.setNumber(tempC, 2);
          sevseg.refreshDisplay(); // Must run repeatedly
          StartTime = CurrentTime;
      }
  }
  
  float tempRequest() {
      reading = analogRead(tempPin);
      tempC = reading / 9.31;
      return tempC;
  }
  </code></pre>