Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: GrabTest R5 2016 Robotics Team 1
Gripper.cpp
- Committer:
- j_j205
- Date:
- 2016-04-09
- Revision:
- 3:5e473aa5381f
- Parent:
- 0:f1aeb307ab68
File content as of revision 3:5e473aa5381f:
#include "Gripper.h"
Gripper::Gripper(PinName gripPin, PinName wristPin) : gripPwm(gripPin), wristPwm(wristPin)
{
gripPwm.period_us(PWM_PER);
wristPwm.period_us(PWM_PER);
gripPwm.pulsewidth_us(GRIP_DEF);
wristPwm.pulsewidth_us(WRIST_DEF);
}
void Gripper::grip() { gripPwm.pulsewidth_us(GRIP_CLOSE); }
void Gripper::release() { gripPwm.pulsewidth_us(GRIP_OPEN); }
void Gripper::lift() { wristPwm.pulsewidth_us(WRIST_UP); }
void Gripper::lower() { wristPwm.pulsewidth_us(WRIST_DOWN); }