better live output
This commit is contained in:
		
							
								
								
									
										11
									
								
								src/main.cpp
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								src/main.cpp
									
									
									
									
									
								
							@@ -36,10 +36,10 @@ void loop() {
 | 
			
		||||
        double watt = current * voltage;
 | 
			
		||||
        double amphours = current / (3600.0 / INTERVALTIME); // every 10secs is a measurement point...
 | 
			
		||||
        all += amphours;
 | 
			
		||||
        Serial.print(all * 1000.0, 5);
 | 
			
		||||
        Serial.print(all * 1000.0, 2);
 | 
			
		||||
        Serial.print("mA/h already captured after - ");
 | 
			
		||||
        Serial.print(time * INTERVALTIME);
 | 
			
		||||
        Serial.println("s");
 | 
			
		||||
        Serial.print((time * INTERVALTIME) / 60);
 | 
			
		||||
        Serial.println("min");
 | 
			
		||||
 | 
			
		||||
        Serial.print("Watts: ");
 | 
			
		||||
        Serial.println(watt);
 | 
			
		||||
@@ -49,7 +49,7 @@ void loop() {
 | 
			
		||||
    } else if (voltage <= MINVOLTAGE) {
 | 
			
		||||
        digitalWrite(MOSFETPIN, LOW);
 | 
			
		||||
        Serial.print("FINISHED voltage below minvoltage - ");
 | 
			
		||||
        Serial.print(all * 1000, 5);
 | 
			
		||||
        Serial.print(all * 1000, 2);
 | 
			
		||||
        Serial.print("mA/h in - ");
 | 
			
		||||
        Serial.print(time * INTERVALTIME);
 | 
			
		||||
        Serial.println("s");
 | 
			
		||||
@@ -62,7 +62,6 @@ void loop() {
 | 
			
		||||
    Serial.println(voltage);
 | 
			
		||||
 | 
			
		||||
    unsigned int delaytime = (micros() - oldtime) / 1000;
 | 
			
		||||
    Serial.println(INTERVALTIME * 1000 - delaytime);
 | 
			
		||||
    delay(INTERVALTIME * 1000 - delaytime);
 | 
			
		||||
    delay(INTERVALTIME * 1000 - delaytime); // application loops here for ap. 5 secs
 | 
			
		||||
    oldtime = micros();
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user