Printing on 4 digit screen

hello all,

wondering if anyone can help me here... im trying to take a tempurature reading and output the first two digits to the first two digits of the 4 digit screen and have my second two for the degree c. i have the temp sensor working and the degree c on the screen but im trying to figure out how to print the other digits.

att is a copy of my code so far.

#include <thermistor.h>

#include <SevSeg.h>



int ThermistorPin = 0;
int Vo;
float R1 = 10000;
float logR2, R2, T;
float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;

//initializing readout screen 

int pinA = 2;
int pinB = 3;
int pinC = 4;
int pinD = 5;
int pinE = 6;
int pinF = 7;
int pinG = 8;
int D1 = 9;
int D2 = 10;
int D3 = 11;
int D4 = 12;

void setup() {
Serial.begin(9600);

// initialize the digital screen pins as outputs.
  pinMode(pinA, OUTPUT);     
  pinMode(pinB, OUTPUT);     
  pinMode(pinC, OUTPUT);     
  pinMode(pinD, OUTPUT);     
  pinMode(pinE, OUTPUT);     
  pinMode(pinF, OUTPUT);     
  pinMode(pinG, OUTPUT);   
  pinMode(D1, OUTPUT);  
  pinMode(D2, OUTPUT);  
  pinMode(D3, OUTPUT);  
  pinMode(D4, OUTPUT);  

}

void temp() {

  Vo = analogRead(ThermistorPin);
  R2 = R1 * (1023.0 / (float)Vo - 1.0);
  logR2 = log(R2);
  T = (1.0 / (c1 + c2*logR2 + c3*logR2*logR2*logR2));
  T = T - 273.15;
 // T = (T * 9.0)/ 5.0 + 32.0; 

  Serial.print("Temperature: "); 
  Serial.print(T);
  Serial.println(" C"); 

  delay(1);
}

void screen(){

  /*
   
  digitalWrite(D1,HIGH);
  digitalWrite(D2, LOW);
  digitalWrite(D3, LOW);
  digitalWrite(D4, LOW); 
  
  // FIRST DIGIT 
  digitalWrite(pinA, LOW);   
  digitalWrite(pinB, LOW);   
  digitalWrite(pinC, LOW);   
  digitalWrite(pinD, LOW);   
  digitalWrite(pinE, LOW);   
  digitalWrite(pinF, LOW);   
  digitalWrite(pinG, HIGH);   
  delay(1);
  
  digitalWrite(D1, HIGH);
  digitalWrite(D2, LOW);
  digitalWrite(D3, LOW);
  digitalWrite(D4, LOW); 
  
  //SECOND DIGIT
  
  digitalWrite(pinA, HIGH);   
  digitalWrite(pinB, HIGH);   
  digitalWrite(pinC, HIGH);   
  digitalWrite(pinD, HIGH);   
  digitalWrite(pinE, HIGH);   
  digitalWrite(pinF, HIGH);   
  digitalWrite(pinG, HIGH);   
  delay(1);              
  
  digitalWrite(D1, LOW);
  digitalWrite(D2, HIGH);
  digitalWrite(D3, LOW);
  digitalWrite(D4, LOW); 
  
  digitalWrite(pinA, HIGH);   
  digitalWrite(pinB, LOW);   
  digitalWrite(pinC, LOW);   
  digitalWrite(pinD, HIGH);   
  digitalWrite(pinE, HIGH);   
  digitalWrite(pinF, HIGH);   
  digitalWrite(pinG, HIGH);   
  delay(1);
              
  */

  //THIRD DIGIT 
  digitalWrite(D1, LOW);
  digitalWrite(D2, LOW);
  digitalWrite(D3, HIGH);
  digitalWrite(D4, LOW); 

  //DEGREE SYMBOL

  digitalWrite(pinA, LOW);   
  digitalWrite(pinB, LOW);   
  digitalWrite(pinC, HIGH);   
  digitalWrite(pinD, HIGH);   
  digitalWrite(pinE, HIGH);   
  digitalWrite(pinF, LOW);   
  digitalWrite(pinG, LOW);     
  delay(1);  
  
//FOURTH DIGIT 

  digitalWrite(D1, LOW);
  digitalWrite(D2, LOW);
  digitalWrite(D3, LOW);
  digitalWrite(D4, HIGH); 

  //CELSIUS 

  digitalWrite(pinA, LOW);   
  digitalWrite(pinB, HIGH);   
  digitalWrite(pinC, HIGH);   
  digitalWrite(pinD, LOW);   
  digitalWrite(pinE, LOW);   
  digitalWrite(pinF, LOW);   
  digitalWrite(pinG, HIGH);     
  delay(1);             
}

void loop(){
  temp();
  screen();
}

Instructions and examples for use of the SevSeg library, here.

groundFungus:
Instructions and examples for use of the SevSeg library, here.

ive looked at the docs for the screen, but after of hours of searching and trying to trouble shoot i still cant seperate the two temp digits to print on the screen.

ex: 10 degree C ... print the 1 on first screen and the 0 on the second screen.
this is what i have so far.

If I am to help you I need to know more about your "screen". Can you post a data sheet for the display, please? Did you read the SevSeg library usage instructions and/or look at any of the examples that are included with the library?

Hi,
Have you looked in the Examples in the IDE?

There are two example codes on how to use the <SevSeg.h> library.

It will save you lot of code and memory.

Tom... :slight_smile:

groundFungus:
If I am to help you I need to know more about your "screen". Can you post a data sheet for the display, please? Did you read the SevSeg library usage instructions and/or look at any of the examples that are included with the library?

unfortunately i do not hav e a data sheet for the screen or dont know where to find one ... i got the the screen off an amazon 37 in 1 kit.

Hi,
I think your screen is a "4 digit 7segment Display", technically its not a screen, but a display.

Like this;
41d6utc+XzL.SY355.jpg
Can you post a picture of your project so we can identify your components?

Thanks.. Tom... :slight_smile:

41d6utc+XzL.SY355.jpg

TomGeorge:
Can you post a picture of your project so we can identify your components?

Thanks.. Tom... :slight_smile:

hello attached is a picture of my project

unfortunately i am unable to post pictures, it gives me an error every time i try.

How to upload images.