Temperature Display LM35 on 7 Segment

Thread Starter

dinesh.taragi

Joined May 26, 2020
3
Hello everyone,

Need your help to display temperature on 7 Segment.
ShiftDisplay.h library is used but couldnt succeed.

C-like:
#include <ShiftDisplay.h>


const int LATCH_PIN = 8;

const int CLOCK_PIN = 10;

const int DATA_PIN = 6;


const DisplayType DISPLAY_TYPE = COMMON_ANODE; // COMMON_CATHODE or COMMON_ANODE


const int DISPLAY_SIZE = 8 ; // 8 // number of digits (Common anode or cathode) on display


ShiftDisplay display(LATCH_PIN, CLOCK_PIN, DATA_PIN, DISPLAY_TYPE, DISPLAY_SIZE);


float getTemperature() {

delay(1000); // simulate processing

return 21.36;

}


String getCondition() {

delay(1000); // simulate processing

return "Sunny";

}


void setup() {

}


void loop() {

float temp = getTemperature();

String condition = getCondition();

condition = " " + condition; // prefix with spaces


// for 4 seconds, show temperature with one decimal, aligned to center of display // display.set(temp, 1, ALIGN_CENTER);

display.set(temp, 1, ALIGN_CENTER); // display.set(temp, 0, ALIGN_CENTER); // No DP

display.show(4000);


// show condition with marquee effect

while (condition.length() > 0) {

display.set(condition, ALIGN_LEFT);

display.show(500);

condition.remove(0, 1);

}

}
 

MrChips

Joined Oct 2, 2009
34,627
You come short on information. The following would help us to help you.

What microcontroller and software development platform are you using?
Where is your circuit diagram?
What does "couldnt succeed" mean?
 

MrChips

Joined Oct 2, 2009
34,627
AAC is an educational site to help members solve their electric/electronics/computer related problems.
It would be rather disingenuous of you to present a poor description of a problem and then walk away saying the problem is solved with no further explanation.

If you prefer, we can remedy your registration on AAC.
 

MrSalts

Joined Apr 2, 2020
2,767
Hello everyone,

Need your help to display temperature on 7 Segment.
ShiftDisplay.h library is used but couldnt succeed.
Welcome to all about circuits. I'm glad to hear you figured out your problem on your own. That's a great feeling. Way more rewarding than getting an answer from someone else. I really appreciate that you stopped by to share your success with us. Keep up the good work. If you have another question in the future, a bit more detail would be great. But I understand that sometimes, just writing down the question helps organize your thoughts and you get it figured out yourself. Have a great day.
 
Top