As for the suggestion to look at the last thing I did, it is unchanged since I had successfully compiled it.
As for warnings? Should I ignore them?
I tried including the sketch, but I get the error here that it's over 9000 characters. I'll put the start of it here:
/* Drapery Controller v2 Dave Powell 7/15 - 8/7/15
#include <EEPROM.h>
const int Dark = 0; // Indicates light is below the set threshold level.
const int Transition = 1; // Indicates light is between Dark and Threshold + 25.
const int Bright = 2; // Indicates light is bright day.
const int Opened = 1; // For EEPROM to remember current drape position.
const int Closed = 0; // For EEPROM to remember current drape position.
int N; // Utility temporary variable.
int RunTimeSet; // Run time trim from pot.
int RunTime; // Actual run time, nominally 11 seconds.
int Timer = 0; // Timer, counts 1 second loops. This timer
// is to ensure that either bright
// or dark exists continuously for five minutes
// before drape movement.
int Satisfied = HIGH; // Flag to indicate no action needed.
int LightLevel; // Light level from the photocell.
int Threshold; // Threshold pot factored for correct range.
int LightMode; // Dark, Transition, or Bright.
int OldLightMode; // Last time through, detects change in light status.
int CurrentPosition; // Saved in EEPROM, holds current drape position.
int TimerRun = LOW; // Controls sense delay timer.
unsigned long HoldStart = 0; // Holds the drape closed for two hours.
void setup() {
digitalWrite(11, HIGH); // Flash to start
delay(200);
digitalWrite(11,LOW);
delay(200);
digitalWrite(11, HIGH);
delay(200);
digitalWrite(11,LOW);
Serial.begin(9600); // Start serial output for testing.
pinMode(2, INPUT);
pinMode(3, INPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
CurrentPosition = EEPROM.read(1000); // Read the last drape position from the EEPROM.
if (CurrentPosition > 1) { // Solves wrong initial value from EEPROM.
CurrentPosition = 1;
}
}
void loop() {
// MOTOR STOP
// ==========
digitalWrite(8, LOW); // Motor off,
digitalWrite(9, LOW); // both directions.
// HALF SECOND DELAY
// ================
// The following makes the loop nominally 0.5 second.
digitalWrite(10, HIGH); // Trigger the watchdog timer high.
if (TimerRun != 0) { // If in the 5 minute delay,
if (HoldStart == 0){ // and not in hold closed,
digitalWrite(11, HIGH); // turn the white LED on.
}
}
delay(250); // Wait 0.25 second.
digitalWrite(10, LOW); // Now set the watchdog low.
if (TimerRun != 0) { // If in the 5 minute delay,
if (HoldStart == 0) { // and not in hold closed,
digitalWrite(11, LOW); // turn the white LED off, advance
Timer = Timer + 1; // the count on the 5 minute timer.
}
}
delay(250); // Wait another 0.25 second.
// READ THE INPUTS
// ===============
N = analogRead(1); // Get threshold setting.
Threshold = (N/4 + 10); // Set the adjustment range.
N = analogRead(2); // Get runtime adjustment value.
RunTime = 8000 + (1000 * (N/170)); // Set time range to 8000 - 14000 milliseconds.
LightLevel = analogRead(3); // Get ambient light level.
// MEASURE THE LIGHT
// =================
OldLightMode = LightMode; // Note the existing mode.
LightMode = Transition; // Start at the middle light range.
if (LightLevel > (Threshold + 25)) { // If bright, reset to that.
LightMode = Bright;
digitalWrite(5, HIGH); // Light the green LED.
digitalWrite(6, LOW); // Extinguish the red LED.
}
if (LightLevel < Threshold) { // If dark, reset to that.
LightMode = Dark;
digitalWrite(6, HIGH); // light the red LED.
digitalWrite(5, LOW); // Extinguish the green LED.
}
// "SATISFIED" DETERMINATION:
// DOES DRAPE MATCH LIGHT LEVEL?
// =============================
Satisfied = HIGH; // Set true to start with.
if (LightMode == Bright) { // Is action needed?
if (CurrentPosition == Closed){ // Is it closed and bright?
Satisfied = LOW; // Action is needed.
}}
if (LightMode == Dark) {
if (CurrentPosition == Opened){ // Is it opened and dark?
Satisfied = LOW; // Action is needed.
}}
if (Satisfied == HIGH) { // If no action needed, stop the timer.
Timer = 0;
TimerRun = LOW;
}
// PROCESS CHANGE OF LIGHT MODE
// ============================
if (LightMode != OldLightMode) { // Has the mode changed?
if (Satisfied == LOW){
Timer = 0; // Zero the counter.
TimerRun = HIGH; // Start the 5 minute timer.
}
}
if (LightMode == Transition) { // If middle range, kill the LEDs.
digitalWrite(5, LOW); // Extinguish the green LED.
digitalWrite(6, LOW); // Extinguish the red LED.
TimerRun = LOW; // Stop the timer.
}
// MANUAL CLOSE
// ============
N = digitalRead(3); // Is the switch down (close request)?
if (N == HIGH) { // If so,
if (CurrentPosition == Opened) { // are the drapes open?
Timer = 0; // Reset the timer,
TimerRun = HIGH; // and start it.
digitalWrite(9, HIGH); // If so, close the drapes.
delay(RunTime); // Run for about 11 seconds.
digitalWrite(9, LOW); // Stop the motor.
CurrentPosition = Closed; // Update the position memory.
EEPROM.write(1000, Closed); // Save in EEPROM in case of restart.
HoldStart = millis(); // Set the hold start time to hold 2 hours,
digitalWrite(11, HIGH); // and light the white LED.
and more...