     mode = Serial.parseInt();
     if (mode == 0) {
       Serial.println("Stopping motor");
-      digitalWrite(gate, LOW);
+      digitalWrite(gatePin, LOW);
     }
     else {
       Serial.println("Starting motor");

    }
    delay(500);
  }
  delay(50);
}

void startMotor() {
  outputValue = 0;
  while (outputValue < 256) {
    analogWrite(gate, outputValue);
    outputValue++;
    delay(10);
  }
}


const int gatePin = 11;
const int tempPin = A0;
const int lightPin = A1;
int mode, tempVal, outputValue;

void setup() {
  Serial.begin(9600);
  pinMode(gatePin, OUTPUT);
  pinMode(tempPin, INPUT);
  pinMode(lightPin, INPUT);
  Serial.println("Enter 0 or 1");
}

