remove debug prints
This commit is contained in:
parent
264db45641
commit
925e82d628
19
src/main.cpp
19
src/main.cpp
|
@ -213,22 +213,16 @@ void loopHandler() {
|
||||||
if (numberdisplay<0) {
|
if (numberdisplay<0) {
|
||||||
numberdisplay*=-1;
|
numberdisplay*=-1;
|
||||||
_negative=true;
|
_negative=true;
|
||||||
Serial.print("negative, ");
|
|
||||||
}
|
}
|
||||||
Serial.print("numberdisplay="); Serial.print(numberdisplay);
|
if ((numberdisplay>999.9) | (displayresolution==0)) {
|
||||||
if (numberdisplay>999.9 | displayresolution==0) {
|
|
||||||
Serial.print(", 1k");
|
|
||||||
display.showNumberDec((int)(numberdisplay+0.5), false); //just diplay number
|
display.showNumberDec((int)(numberdisplay+0.5), false); //just diplay number
|
||||||
}else{
|
}else{
|
||||||
Serial.print(", low-");
|
|
||||||
uint8_t d1=0;
|
uint8_t d1=0;
|
||||||
uint8_t d2=0;
|
uint8_t d2=0;
|
||||||
uint8_t d3=0;
|
uint8_t d3=0;
|
||||||
uint8_t d4=0;
|
uint8_t d4=0;
|
||||||
if(numberdisplay<10 && displayresolution>=3) { // 5.241, 0.005 etc.
|
if(numberdisplay<10 && displayresolution>=3) { // 5.241, 0.005 etc.
|
||||||
Serial.print("<10");
|
|
||||||
int _number=(int)(numberdisplay*1000+0.5); //in 1000th kg rounded
|
int _number=(int)(numberdisplay*1000+0.5); //in 1000th kg rounded
|
||||||
Serial.print(" = "); Serial.print(_number);
|
|
||||||
d1=_number%10;
|
d1=_number%10;
|
||||||
d2=(_number/10)%10;
|
d2=(_number/10)%10;
|
||||||
d3=(_number/100)%10;
|
d3=(_number/100)%10;
|
||||||
|
@ -239,9 +233,7 @@ void loopHandler() {
|
||||||
display_data[0] = display.encodeDigit(d4); //leftmost digit
|
display_data[0] = display.encodeDigit(d4); //leftmost digit
|
||||||
display_data[0] |= SEG_DP; //add decimal point after left most digit
|
display_data[0] |= SEG_DP; //add decimal point after left most digit
|
||||||
}else if(numberdisplay<100 && displayresolution>=2) { //10.24, 99.20
|
}else if(numberdisplay<100 && displayresolution>=2) { //10.24, 99.20
|
||||||
Serial.print("<100");
|
|
||||||
int _number=(int)(numberdisplay*100+0.5); //in 100th kg rounded
|
int _number=(int)(numberdisplay*100+0.5); //in 100th kg rounded
|
||||||
Serial.print(" = "); Serial.print(_number);
|
|
||||||
d1=_number%10;
|
d1=_number%10;
|
||||||
d2=(_number/10)%10;
|
d2=(_number/10)%10;
|
||||||
d3=(_number/100)%10;
|
d3=(_number/100)%10;
|
||||||
|
@ -256,9 +248,7 @@ void loopHandler() {
|
||||||
}
|
}
|
||||||
}else if (numberdisplay<1000 && displayresolution>=1) //100.0, 999.9
|
}else if (numberdisplay<1000 && displayresolution>=1) //100.0, 999.9
|
||||||
{
|
{
|
||||||
Serial.print("<1000");
|
|
||||||
int _number=(int)(numberdisplay*10+0.5); //in 10th kg rounded
|
int _number=(int)(numberdisplay*10+0.5); //in 10th kg rounded
|
||||||
Serial.print(" = "); Serial.print(_number);
|
|
||||||
d1=_number%10;
|
d1=_number%10;
|
||||||
d2=(_number/10)%10;
|
d2=(_number/10)%10;
|
||||||
d3=(_number/100)%10;
|
d3=(_number/100)%10;
|
||||||
|
@ -280,9 +270,6 @@ void loopHandler() {
|
||||||
display_data[3] |= SEG_DP;
|
display_data[3] |= SEG_DP;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
*/
|
|
||||||
Serial.println();
|
Serial.println();
|
||||||
display.setSegments(display_data);
|
display.setSegments(display_data);
|
||||||
|
|
||||||
|
@ -397,8 +384,8 @@ bool cmdHandler(const HomieRange& range, const String& value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void powerOff() {
|
void powerOff() {
|
||||||
//Serial.println("Turning Off");
|
Serial.println("Turning Off");
|
||||||
//Serial.flush();
|
Serial.flush();
|
||||||
delay(100);
|
delay(100);
|
||||||
digitalWrite(PIN_SELFENABLE, LOW);
|
digitalWrite(PIN_SELFENABLE, LOW);
|
||||||
}
|
}
|
Loading…
Reference in New Issue