farmbot-arduino-firmware/src/F16Handler.cpp

49 lines
646 B
C++
Raw Normal View History

2014-10-09 15:35:26 -06:00
/*
* F16Handler.cpp
*
* Created on: 2014/07/21
* Author: MattLech
*/
#include "F16Handler.h"
2017-04-19 08:12:12 -06:00
static F16Handler *instance;
F16Handler *F16Handler::getInstance()
{
if (!instance)
{
instance = new F16Handler();
};
return instance;
};
F16Handler::F16Handler()
{
2014-10-09 15:35:26 -06:00
}
2017-04-19 08:12:12 -06:00
int F16Handler::execute(Command *command)
{
int ret = 0;
2014-10-09 15:35:26 -06:00
2017-04-19 08:12:12 -06:00
if (LOGGING)
{
Serial.print("R99 HOME Z\r\n");
}
2014-10-09 15:35:26 -06:00
2019-12-02 14:07:28 -07:00
ret = Movement::getInstance()->calibrateAxis(2);
if (ret == 0) {
2019-12-02 14:07:28 -07:00
Movement::getInstance()->moveToCoords(0, 0, 0, 0, 0, 0, false, false, true);
}
2014-10-09 15:35:26 -06:00
2017-04-19 08:12:12 -06:00
if (LOGGING)
{
CurrentState::getInstance()->print();
}
2014-10-09 15:35:26 -06:00
2017-04-19 08:12:12 -06:00
return 0;
2014-10-09 15:35:26 -06:00
}