![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
This is the code we showed at Uncraftivism
ServoMinder.h@1:70d90598d2e7, 2009-12-10 (annotated)
- Committer:
- jarkman
- Date:
- Thu Dec 10 21:16:57 2009 +0000
- Revision:
- 1:70d90598d2e7
- Parent:
- 0:57f4fdadc97f
- Child:
- 2:01115080f6da
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jarkman | 0:57f4fdadc97f | 1 | #pragma once |
jarkman | 0:57f4fdadc97f | 2 | #include "Servo.h" |
jarkman | 0:57f4fdadc97f | 3 | |
jarkman | 0:57f4fdadc97f | 4 | class ServoMinder |
jarkman | 0:57f4fdadc97f | 5 | { |
jarkman | 0:57f4fdadc97f | 6 | public: |
jarkman | 1:70d90598d2e7 | 7 | ServoMinder( Servo *servo ); |
jarkman | 0:57f4fdadc97f | 8 | |
jarkman | 1:70d90598d2e7 | 9 | void moveTo( float target ); |
jarkman | 1:70d90598d2e7 | 10 | void moveToAndWait( float target ); |
jarkman | 1:70d90598d2e7 | 11 | void setSpeed( float speed ); |
jarkman | 1:70d90598d2e7 | 12 | |
jarkman | 0:57f4fdadc97f | 13 | private: |
jarkman | 1:70d90598d2e7 | 14 | |
jarkman | 0:57f4fdadc97f | 15 | |
jarkman | 1:70d90598d2e7 | 16 | Servo *m_servo; |
jarkman | 1:70d90598d2e7 | 17 | float m_target; |
jarkman | 1:70d90598d2e7 | 18 | float m_speed; |
jarkman | 0:57f4fdadc97f | 19 | |
jarkman | 1:70d90598d2e7 | 20 | float m_delta; |
jarkman | 1:70d90598d2e7 | 21 | float m_tickTime; |
jarkman | 1:70d90598d2e7 | 22 | Ticker m_ticker; |
jarkman | 0:57f4fdadc97f | 23 | |
jarkman | 1:70d90598d2e7 | 24 | void tick(); |
jarkman | 0:57f4fdadc97f | 25 | |
jarkman | 0:57f4fdadc97f | 26 | }; |