![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Gripper and Color sensor basic functionality testing.
Dependencies: mbed
Diff: gripper.h
- Revision:
- 0:b30091b30223
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gripper.h Sat Mar 26 23:30:29 2016 +0000 @@ -0,0 +1,33 @@ +#ifndef GRIPPER_H +#define GRIPPER_H + +#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; +}; +#endif \ No newline at end of file