#include <OzIDManager.h> #include <OzMotorMultiController.h> #include <OzSwitchController.h> OzIDManager* manager; OzMotorMultiController* motorController; OzButtonController* endStopXMin; OzButtonController* endStopYMin; OzSwitchController* switchController; void setup() { Serial.begin(115200); manager = new OzIDManager; manager->_sendACK = true; manager->_checksum = true; OzCommunication::setIDManager(manager); endStopXMin = new OzButtonController(3, CHANGE); endStopYMin = new OzButtonController(2, CHANGE); endStopXMin->_flipped = true; endStopYMin->_flipped = true; motorController = new OzMotorMultiController(PinPreset::LASERCUTTER); motorController->addEndStop(AXIS::X, EndPoint::MIN, endStopXMin); motorController->addEndStop(AXIS::Y, EndPoint::MIN, endStopYMin); switchController = new OzSwitchController(10); int x = 1; manager->sendLinkSetup(); manager->PrintWelcomeLine(motorController, x++, "MyStepperMotors"); manager->PrintWelcomeLine(endStopXMin, x++, "MyEndStopX"); manager->PrintWelcomeLine(endStopYMin, x++, "MyEndStopY"); manager->PrintWelcomeLine(switchController, x++, "MyLaser"); } void loop() { OzCommunication::communicate(); motorController->ownLoop(); }
More information