   radar.setPace(30);
   long interval = 0;
   async = BackgroundTask(interval);
+
+  radarData.observe(angle);
+  radarData.observe(objectDistance);
 }
 
 void loop() {
   async.Update();
+  
   radar.rotate(0,180);
-
-  //Serial.print(radar.getAngle());
-  //Serial.print(',');
-  //Serial.print(calculateDistance());
-  //Serial.print('.');
+  angle = radar.getAngle();
+  objectDistance = calculateDistance();
+  radarData.sync();
   
   if(Serial.available()){
     char temp = Serial.read();

#include "Engine.h"
#include "Servoi2c.h"
#include "BackgroundTask.h"

char steer_command;
char move_command;
char gear_command;

//Trig and Echo pins of the Ultrasonic Sensor

const int trigPin = 7;
const int echoPin = 6;

Car car;
Servoi2c radar;
BackgroundTask async;

void setup() {
  pinMode(trigPin, OUTPUT);

    }
}

// Function for calculating the distance
int calculateDistance(){ 
  long duration;
  digitalWrite(trigPin, LOW); 
  delayMicroseconds(2);
  // Set trigPin on HIGH state for 10 micro seconds
  digitalWrite(trigPin, HIGH); 
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH); // Read sound wave travel time in microseconds
  objectDistance = duration*0.034/2;
  return objectDistance;
}
