 // These constants won't change.  They're used to give names
 // to the pins used:
 const int analogOutPin = 3; // Analog output pin that the LED is attached to
+const int analogInPin = A0;
+const int pumpPin = 4;
 const int ledPin = 13;
+long dropCounter;
 float delayValue = 0.0;
+int sensorValue;
 String inputString = "";         // A string to hold incoming data
 boolean stringComplete = false;  // Whether the string is complete
 int outputValue = 0;
 float receivedValue = 0.0;
+boolean levelWasDown = true;
+boolean levelIsDown = true;
+boolean freeze = false;
 void setup() {
   // initialize serial communications at 9600 bps:
-  Serial.begin(9600); 
+  Serial.begin(9600);
+    pinMode(pumpPin, OUTPUT); 
+    pinMode(analogOutPin, OUTPUT); 
 }
 
 void serialEvent() {

  // wait 2 milliseconds before the next loop
  // for the analog-to-digital converter to settle
  // after the last reading:


  // change the analog out value:
  analogWrite(analogOutPin, int(receivedValue));

       digitalWrite(analogOutPin, LOW);    // turn the LED off by making the voltage LOW
       delay(delayValue);         // wait for a second
       digitalWrite(ledPin, HIGH);   // turn the LED on (HIGH is the voltage level)
       if (!freeze) //only if not problem
       {
         digitalWrite(analogOutPin, HIGH);   // turn the flow on (HIGH is the voltage level)
         dropCounter++;
       }
       delay(900);               // wait for a second
       
   }
}
