Display zero in seven segment

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
moparx12
 
Posts: 8
Joined: Sun Nov 03, 2013 2:47 pm

Display zero in seven segment

Post by moparx12 »

I am having trouble displaying the actual value of "0" on my seven segment 4 digit LED display from you guys.

here is my code:

if (smoothData1 == 0) {
matrix.writeDigitNum(4, 0x00);
matrix.writeDisplay();
}
//else if (smoothData1 < 0) {
//matrix.writeDigitNum(4, 0x00);
//matrix.writeDisplay();
//}
else if (smoothData1 > 4094) {
matrix.println(10000, DEC);
matrix.writeDisplay();
}
else {
matrix.println(mappedADC);
matrix.writeDisplay();
//Serial.println(smoothData1);
delay(100);
}



delay(100);

Code: Select all

 if (smoothData1 == 0) {
   matrix.writeDigitNum(4, 0x00);
   matrix.writeDisplay();   
 }
 //else if (smoothData1 < 0) {
 //matrix.writeDigitNum(4, 0x00);
 //matrix.writeDisplay();   
 //}
 else if (smoothData1 > 4094) {
   matrix.println(10000, DEC);
   matrix.writeDisplay();   
 }
 else { 
   matrix.println(mappedADC);
   matrix.writeDisplay();
   //Serial.println(smoothData1);
   delay(100);
 }
 

   
 delay(100); 

this is for a scale readout so i need the zero to display. Any suggestions?

Thanks!

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Display zero in seven segment

Post by adafruit_support_mike »

What output do you get from the code you've posted?

moparx12
 
Posts: 8
Joined: Sun Nov 03, 2013 2:47 pm

Re: Display zero in seven segment

Post by moparx12 »

i figured it out... smoothedData1 is from a function that will never return zero. therefore i found that if i look at the "mappedADC" value (the value that is actually being printed, mapped from smoothedData1), it does display the zero!

thanks

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”