 }
 
 void loop(){
-  int val = 789789;
-  if (val == 789789 || val != digitalRead(3)){
+  if (val == 2){
+    val = digitalRead(3);
+  }
+  
+  else if (val != digitalRead(3)){
     val = digitalRead(3); 
     
     if (val == HIGH){
-      Serial.write("ON");
+      Serial.println("ON");
       Serial.println("000"); //healthy
     }
   
     else if (val == LOW){
-      Serial.write("OFF");
+      Serial.println("OFF");
       Serial.println("000"); //healthy
     }
   

    else{
      Serial.println("002"); //Something is wrong with the RPi Communication
    }  
  }*/
  delay(50); 
}

#include <Servo.h>

Servo magnetServo;
int val = 2;

void setup(){
  Serial.begin(9600);
