Giancarlo R.
/
Arm_Serial_Coordinates
Takes in serial coordinates (in mm) and moves servos in Lynxmotion AL5 arm accordingly.
robo.h@0:4a15e2d20446, 2011-12-14 (annotated)
- Committer:
- gvalentin3
- Date:
- Wed Dec 14 17:08:38 2011 +0000
- Revision:
- 0:4a15e2d20446
First published version. Height is still hardcoded to -70mm.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gvalentin3 | 0:4a15e2d20446 | 1 | //Robo class header for controlling robotic arm |
gvalentin3 | 0:4a15e2d20446 | 2 | //Created 10/12/2011 by MLD 427 |
gvalentin3 | 0:4a15e2d20446 | 3 | |
gvalentin3 | 0:4a15e2d20446 | 4 | #include "mbed.h" |
gvalentin3 | 0:4a15e2d20446 | 5 | class robo{ |
gvalentin3 | 0:4a15e2d20446 | 6 | private: |
gvalentin3 | 0:4a15e2d20446 | 7 | PwmOut *spin; |
gvalentin3 | 0:4a15e2d20446 | 8 | PwmOut *base; |
gvalentin3 | 0:4a15e2d20446 | 9 | PwmOut *elbow; |
gvalentin3 | 0:4a15e2d20446 | 10 | PwmOut *wrist; |
gvalentin3 | 0:4a15e2d20446 | 11 | PwmOut *claw; |
gvalentin3 | 0:4a15e2d20446 | 12 | PwmOut *trash; |
gvalentin3 | 0:4a15e2d20446 | 13 | public: |
gvalentin3 | 0:4a15e2d20446 | 14 | robo(PinName s, PinName b, PinName e, PinName w, PinName c, PinName t); |
gvalentin3 | 0:4a15e2d20446 | 15 | void write(float percent, int motor); |
gvalentin3 | 0:4a15e2d20446 | 16 | void writeSpin(float percent); |
gvalentin3 | 0:4a15e2d20446 | 17 | void writeBase(float percent); |
gvalentin3 | 0:4a15e2d20446 | 18 | void writeElbow(float percent); |
gvalentin3 | 0:4a15e2d20446 | 19 | void writeWrist(float percent); |
gvalentin3 | 0:4a15e2d20446 | 20 | void writeClaw(float percent); |
gvalentin3 | 0:4a15e2d20446 | 21 | void writeTrash(float percent); |
gvalentin3 | 0:4a15e2d20446 | 22 | float* calculateangle(float x1e, float y1e, float oe, float angles[]); |
gvalentin3 | 0:4a15e2d20446 | 23 | |
gvalentin3 | 0:4a15e2d20446 | 24 | |
gvalentin3 | 0:4a15e2d20446 | 25 | }; |