MDX-15,20の制御用library
MDX20.h
- Committer:
- suupen
- Date:
- 2016-11-26
- Revision:
- 5:bd414d8e483f
- Parent:
- 4:b01a67ab40cf
- Child:
- 6:b61356230acf
File content as of revision 5:bd414d8e483f:
#ifndef MBED_MDX20_H #define MBED_MDX20_H #include "mbed.h" #include "BufferedSerial.h" #include "float.h" class MDX20 { public: MDX20(PinName tx, PinName rx, PinName cts); ~MDX20(); void clearPositon(void); void answerPositon(int16_t *position); void answerPositonMillimeter(float *position); void integralPosition(char *str); uint8_t xyOrigin(void); uint8_t zOrigin(void); uint8_t sendData(char* data); uint8_t reciveData(void); int putc(int c); uint8_t initial(void); uint8_t motorOff(void); uint8_t userOriginInitial(void); uint8_t final(void); // uint8_t zeroSetting(void); uint8_t XYZMove(int16_t x, int16_t y, int16_t z); private: BufferedSerial _serial; // tx, rx(NC) DigitalIn _cts; char B_masterTx[0xff]; double D_position[3]; //[0]:x, [1]:y, [2]:z double D_userOriginPosition[3]; //[0]:x, [1]:y, [2]:z #define countToMillimeter (0.025) #define Z_x (0) #define Z_y (1) #define Z_z (2) }; #endif // MBED_MDX20_H