     //Serial.println("++");
     return rawAngle;
   }
-  
+
 }
 
 int readline(int readch, char *buffer, int len){
-  
+
   static int pos = 0;
   int rpos;
-  
+
   if (readch > 0) {
-   
+
     switch (readch) {
       case '\r':
         rpos = pos;

      case 1024: mode = 0x05; break;
      default: return;
    }
    if(pin == 5 || pin == 6) { 
      TCCR0B = TCCR0B & 0b11111000 | mode; // Timer0
    } else {
      TCCR1B = TCCR1B & 0b11111000 | mode; // Timer1

    Serial.println("}");
    lastRange=currentRange;
  }

  float heading=readHeading();
  if(abs(lastHeading-heading)>=2){
    Serial.print("{\"onHeadingChange\":");
