#include <OzIDManager.h>
#include <OzAnalogJoyController.h>

// global pointers
OzIDManager* manager;
OzAnalogJoyController* analogJoyController;

// Joystick pins
const int buttonPin = 2;
const int xPin = A1;
const int yPin = A0;

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

  manager = new OzIDManager;
  manager->_sendACK = true;
  manager->_checksum = true;
  
  OzCommunication::setIDManager(manager);

  analogJoyController = new OzAnalogJoyController(xPin, yPin, buttonPin);
  analogJoyController->reset(); //resets origo to current position

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

void loop()
{
  OzCommunication::communicate();
  analogJoyController->update();
}

More information