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-rtos mbed QEI
Diff: Actuators/Arms/Arm.h
- Revision:
- 1:8119211eae14
- Child:
- 2:45da48fab346
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Actuators/Arms/Arm.h Fri Mar 29 16:28:56 2013 +0000
@@ -0,0 +1,62 @@
+
+// Eurobot13 WhiteArm.h
+
+#include "mbed.h"
+#include "Servo.h"
+
+class Arm : public Servo
+{
+private:
+ bool updirn;
+
+public:
+ Arm(PinName yellow, bool upflip = false, float range = 0.0005, float degrees = 45.0) : Servo(yellow) {
+ calibrate(range, degrees);
+ updirn = upflip;
+ }
+
+ void operator()(float in) {
+ write(in);
+ }
+
+ void clockwise() { // full lock clockwise
+ write(updirn?1:0);
+ }
+
+ void anticlockwise() { // full lock anticlockwise
+ write(updirn?0:1);
+ }
+
+ void relax() { // servo applies no force
+ _pwm = 0;
+ }
+};
+
+
+/*
+class Servo{
+ private:
+ PwmOut PWM;
+
+ public:
+ Servo(PinName pin1) : PWM(pin1){
+ }
+
+ void operator()(float in){
+ PWM = in;
+ }
+
+ void clockwise() { // full lock clockwise
+ PWM = .135;
+ }
+
+ void anticlockwise() { // full lock anticlockwise
+ PWM = .025;
+ }
+
+ void relax() { // servo applies no force
+ PWM = 0;
+ }
+
+};
+*/
\ No newline at end of file