 // Rain 
 #define DPIN_RAIN 12           
 // input from rain sensor (digital)
+#define APIN_RAIN 0
+// input for analog rain sensor (analog)
+#define MILLIVOLTS_PER_COUNT 4.8828
+// Conversion factor to get millivolts per DIO count
 
 // Global variables
 

int requeststate = STATE_CLOSED;
int last_state = STATE_UNKNOWN;
int fault, condition;   // global
float duration;

AccelStepper stepper(AccelStepper::DRIVER, DPIN_STEP, DPIN_DIR);  // sets up 2-wire stepper driver


  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) {
