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 Lahis Almeida

Committer:
kevencastro7
Date:
Fri Dec 15 19:40:41 2017 +0000
Revision:
2:835c883d81b0
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.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kevencastro7 2:835c883d81b0 1 #include "Cnc.h"
kevencastro7 2:835c883d81b0 2 #define DELAY 0.075
kevencastro7 2:835c883d81b0 3
kevencastro7 2:835c883d81b0 4 Cnc::Cnc(EixoController* eixoX, EixoController* eixoY, PinName pinValve, PCF8574* pcf, int sensorUp, int sensorDown) : eixoZ(pinValve) {
kevencastro7 2:835c883d81b0 5 this->eixoX = eixoX;
kevencastro7 2:835c883d81b0 6 this->eixoY = eixoY;
kevencastro7 2:835c883d81b0 7 this->pcf = pcf;
kevencastro7 2:835c883d81b0 8 this->sensorUp = sensorUp;
kevencastro7 2:835c883d81b0 9 this->sensorDown = sensorDown;
kevencastro7 2:835c883d81b0 10 debug = new Debug();
kevencastro7 2:835c883d81b0 11 }
kevencastro7 2:835c883d81b0 12
kevencastro7 2:835c883d81b0 13 void Cnc::goToPosition(float posX, int dirX, float posY, int dirY, bool enable){
kevencastro7 2:835c883d81b0 14 eixoX->goToPosition(posX, dirX);
kevencastro7 2:835c883d81b0 15 eixoY->goToPosition(posY, dirY);
kevencastro7 2:835c883d81b0 16 /*if (enable){
kevencastro7 2:835c883d81b0 17 while(!pcf->read(sensorDown))eixoZ = 1;
kevencastro7 2:835c883d81b0 18 eixoZ = 0;
kevencastro7 2:835c883d81b0 19 }*/
kevencastro7 2:835c883d81b0 20 if (enable){
kevencastro7 2:835c883d81b0 21 eixoZ = 1;
kevencastro7 2:835c883d81b0 22 wait(DELAY);
kevencastro7 2:835c883d81b0 23 eixoZ = 0;
kevencastro7 2:835c883d81b0 24 }
kevencastro7 2:835c883d81b0 25 }