Hiroaki Matsuda
/
mbed-for-McuComm
this is program for mbed ,to relay MCUcomm data to servo
command/command.h@1:0fe52e356d01, 2012-12-05 (annotated)
- Committer:
- matsu
- Date:
- Wed Dec 05 15:13:57 2012 +0000
- Revision:
- 1:0fe52e356d01
- Parent:
- 0:09bf8e3091e8
if you send signal from pc to mbed ,servo motor will work that you want
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 | 1:0fe52e356d01 | 17 | void on(); |
matsu | 1:0fe52e356d01 | 18 | void off(); |
matsu | 1:0fe52e356d01 | 19 | bool getPower(); |
matsu | 0:09bf8e3091e8 | 20 | int getPosition(); |
matsu | 0:09bf8e3091e8 | 21 | int getTime(); |
matsu | 0:09bf8e3091e8 | 22 | int getHomeposition(); |
matsu | 0:09bf8e3091e8 | 23 | Command& operator= (float percent); |
matsu | 0:09bf8e3091e8 | 24 | Command& operator= (Command& rhs); |
matsu | 0:09bf8e3091e8 | 25 | protected: |
matsu | 1:0fe52e356d01 | 26 | bool _power; |
matsu | 0:09bf8e3091e8 | 27 | short int _position; |
matsu | 0:09bf8e3091e8 | 28 | short int _time; |
matsu | 0:09bf8e3091e8 | 29 | short int _homePosition; |
matsu | 0:09bf8e3091e8 | 30 | }; |