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.
Dependencies: mbed
Diff: gripper.cpp
- Revision:
- 0:b30091b30223
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gripper.cpp Sat Mar 26 23:30:29 2016 +0000
@@ -0,0 +1,18 @@
+#include "gripper.h"
+#include "mbed.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); }
\ No newline at end of file