el programa permite ingresar la posición en el eje X,Y,Z, haciendo que el Servo MG90S con sus movimientos de 180° trabaje en mm de 0 a 50.
Dependents: PICCOLO_CNC PICCOLO_CNC1
Diff: Servo_X.h
- Revision:
- 4:4b884116fbe6
- Parent:
- 2:cc30b42ac66f
- Child:
- 5:c91bd4adb88b
--- a/Servo_X.h Tue Mar 06 17:14:05 2018 +0000 +++ b/Servo_X.h Thu Mar 08 02:44:07 2018 +0000 @@ -4,27 +4,37 @@ #ifndef SERVO_X_H #define SERVO_X_H -#define MINPULSE 620 -#define MAXPULSE 2450 +#define MINPULSE 560 +#define MAXPULSE 2400 #define MAXPOS 50// poscisión max de la coordenasda en mm #define DRAW 50 #define NODRAW 0 +#define CM_EJECUTAR 0Xff +#define CM_GUARDAR 0Xfe +#define CM_SERVO 0Xfd +#define CM_SDRAW 0xfc +#define CM_SN0DRAW 0xfb +#define CM_STOP 0xfa +#define CM_END 0xf0 + + class Servo { private: - int x,y,z; - int mm2pulse(int vmm); + uint8_t x,y,z; + int mm2pulse(float vmm); public: Servo(); ~Servo(); - void SetServo(int,int); - void SetZ(int); - int GetServoX(); - int GetServoY(); - int GetServoZ(); + void SetServo(uint8_t,uint8_t); + void SetZ(uint8_t); + uint8_t GetServoX(); + uint8_t GetServoY(); + uint8_t GetServoZ(); + int CONVERTIDOR(int); }; #endif