Gripper code for R5 bot
Dependents: GrabTest R5 2016 Robotics Team 1
Gripper.h
- Committer:
- Hypna
- Date:
- 2016-02-24
- Revision:
- 0:f1aeb307ab68
- Child:
- 1:92a09a39e546
File content as of revision 0:f1aeb307ab68:
#include "mbed.h" //definitions for servo PWM settings in us #define GRIP_DEF 1500 #define GRIP_OPEN 1700 #define GRIP_CLOSE 1120 #define WRIST_DEF 1500 #define WRIST_UP 2000 #define WRIST_DOWN 1500 #define PWM_PER 20000 class Gripper { public: //gripPin is pwm pin connected to gripper servo, wristPin is pwm pin connected to wrist servo Gripper(PinName gripPin, PinName wristPin); //closes gripper to fit target void grip(); //fully opens gripper void release(); //raises wrist to target angle void lift(); //lowers wrist to grabbing angle void lower(); private: PwmOut gripPwm; PwmOut wristPwm; };