|
|
@ -32,26 +32,27 @@ class Atomizer { |
|
|
|
|
|
|
|
void calibrate() { |
|
|
|
int reading; |
|
|
|
float s; |
|
|
|
int i, j; |
|
|
|
int wait = 200; |
|
|
|
|
|
|
|
LOG("Calibrating atomizer actuation..."); LOG_NEW_LINE |
|
|
|
|
|
|
|
for(i = 0; i < 5; i++) { |
|
|
|
for(int i = 1; i < 5; i++) { |
|
|
|
LOG("Calibration loop "); LOG(i); LOG_NEW_LINE |
|
|
|
|
|
|
|
// do some readings on current state |
|
|
|
for(int i = 0; i < 10; i++) { |
|
|
|
for(int j = 0; j < 10; j++) { |
|
|
|
reading = analogRead(pinSensor); |
|
|
|
minmax.put( reading ); |
|
|
|
delay(wait); |
|
|
|
} |
|
|
|
|
|
|
|
toggle(); // change state |
|
|
|
|
|
|
|
// do some more readings |
|
|
|
for(int i = 0; i < 10; i++) { |
|
|
|
for(int k = 0; k < 10; k++) { |
|
|
|
reading = analogRead(pinSensor); |
|
|
|
minmax.put( reading ); |
|
|
|
delay(wait); |
|
|
|
} |
|
|
|
|
|
|
|
toggle(); // change state again |
|
|
|