Stap 5: Controlesoftware
Hier tonen we de Arduino hoofdlus alleen.
void loop() //start of main loop
{
Als (manualState == HIGH) if (manualState == HIGH) { // if in Manual Operation Mode
Als ((millis() - manualTimer) < manualInterval) if ( (millis() - manualTimer) < manualInterval) {
Als ((millis() - uploadTimer) > updateInterval) if ( (millis() - uploadTimer) > updateInterval) {
readBMP(); // read sensor values from BMP085
displayLCD(); // update values on LCD
uploadTimer = millis();
}
}
anders else {
manualState = LOW; // if not in Manual Operation Mode
analogWrite(LED_ILLUM_PIN, 0); // Switch off Illumination LEDs
}
}
checkManualOP(); // check if manual operation button has
// been pressed and timer value not over
delay(250); // sleep some time
} // end loop