   state = determine_state();  // open/closed
   condition = determine_cond(); // rain or not
   fault = determine_fault(); // check for motor fault
+  rain_mv = MILLIVOLTS_PER_COUNT * float(analogRead(APIN_RAIN));
   // print if there is a state change
   if (state != last_state) {
     if (state==STATE_OPENED) {

  if (condition == COND_RAIN){
    Serial.print("condition = rain ");    
  }
  Serial.println("");
}

int determine_state() {

void setup() {
  // Start serial for input / output
  Serial.begin(9600);
  Serial.println("EM27Sun Cover Driver v1.2");
  // Set up for the Stepper motor
  stepper.setPinsInverted(true,false,true); // sets direction and enable pins inverted
  stepper.setMaxSpeed(USTEP_DIVISOR * STEP_SPEED);
