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