
This is a remote control tester, it uses a CNC, Ethernet Communication with a JAVAFX interface and a PLC in order to control some valves.
Dependencies: EthernetInterface mbed-rtos mbed
Fork of CNC_CONTROLLER by
Diff: Cnc.cpp
- Revision:
- 2:835c883d81b0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Cnc.cpp Fri Dec 15 19:40:41 2017 +0000 @@ -0,0 +1,25 @@ +#include "Cnc.h" +#define DELAY 0.075 + +Cnc::Cnc(EixoController* eixoX, EixoController* eixoY, PinName pinValve, PCF8574* pcf, int sensorUp, int sensorDown) : eixoZ(pinValve) { + this->eixoX = eixoX; + this->eixoY = eixoY; + this->pcf = pcf; + this->sensorUp = sensorUp; + this->sensorDown = sensorDown; + debug = new Debug(); +} + +void Cnc::goToPosition(float posX, int dirX, float posY, int dirY, bool enable){ + eixoX->goToPosition(posX, dirX); + eixoY->goToPosition(posY, dirY); + /*if (enable){ + while(!pcf->read(sensorDown))eixoZ = 1; + eixoZ = 0; + }*/ + if (enable){ + eixoZ = 1; + wait(DELAY); + eixoZ = 0; + } +} \ No newline at end of file