#include <OzIDManager.h>
#include <OzUltraSonicSensor.h>

OzIDManager* manager;
OzUltraSonicSensor* ultraSonicSensor;

const int triggerPin = 2;
const int echoPin = 4;

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

  manager = new OzIDManager;
  manager->_sendACK = true;
  manager->_checksum = true;

  OzCommunication::setIDManager(manager);

  ultraSonicSensor = new OzUltraSonicSensor(triggerPin, echoPin);

  int x=1;
  manager->sendLinkSetup();
  manager->PrintWelcomeLine(ultraSonicSensor, x++, "Ultra_1");
}

void loop()
{
  ultraSonicSensor->ownLoop();
  OzCommunication::communicate();
}

More information