Hiroaki Matsuda
/
mbed-for-McuComm
this is program for mbed ,to relay MCUcomm data to servo
command/command.h@0:09bf8e3091e8, 2012-11-28 (annotated)
- Committer:
- matsu
- Date:
- Wed Nov 28 17:12:00 2012 +0000
- Revision:
- 0:09bf8e3091e8
- Child:
- 1:0fe52e356d01
to move servo using data from pc by serial; ; ver 1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
matsu | 0:09bf8e3091e8 | 1 | //command.h |
matsu | 0:09bf8e3091e8 | 2 | |
matsu | 0:09bf8e3091e8 | 3 | // command list |
matsu | 0:09bf8e3091e8 | 4 | |
matsu | 0:09bf8e3091e8 | 5 | #include "Servo.h" |
matsu | 0:09bf8e3091e8 | 6 | #include "mbed.h" |
matsu | 0:09bf8e3091e8 | 7 | |
matsu | 0:09bf8e3091e8 | 8 | |
matsu | 0:09bf8e3091e8 | 9 | |
matsu | 0:09bf8e3091e8 | 10 | class Command : public Servo |
matsu | 0:09bf8e3091e8 | 11 | { |
matsu | 0:09bf8e3091e8 | 12 | public: |
matsu | 0:09bf8e3091e8 | 13 | Command(PinName pin); |
matsu | 0:09bf8e3091e8 | 14 | |
matsu | 0:09bf8e3091e8 | 15 | void targetPosition(int number ,int receive); |
matsu | 0:09bf8e3091e8 | 16 | void homePosition(int number ,int receive); |
matsu | 0:09bf8e3091e8 | 17 | void onOff(); |
matsu | 0:09bf8e3091e8 | 18 | int getPosition(); |
matsu | 0:09bf8e3091e8 | 19 | int getTime(); |
matsu | 0:09bf8e3091e8 | 20 | int getHomeposition(); |
matsu | 0:09bf8e3091e8 | 21 | Command& operator= (float percent); |
matsu | 0:09bf8e3091e8 | 22 | Command& operator= (Command& rhs); |
matsu | 0:09bf8e3091e8 | 23 | protected: |
matsu | 0:09bf8e3091e8 | 24 | bool _on; |
matsu | 0:09bf8e3091e8 | 25 | short int _position; |
matsu | 0:09bf8e3091e8 | 26 | short int _time; |
matsu | 0:09bf8e3091e8 | 27 | short int _homePosition; |
matsu | 0:09bf8e3091e8 | 28 | }; |