Librairie pour contrôler un moteur connecté à un contrôleur SDC21XX
Dependencies: CANopen_Node Roboteq_SDC_serie
Dependents: TCP_Server_Example
Fork of SDC21XX_Motor by
SDC21XX_Motor.h@0:1c0bc44980e0, 2016-06-01 (annotated)
- Committer:
- kkoichy
- Date:
- Wed Jun 01 15:03:34 2016 +0000
- Revision:
- 0:1c0bc44980e0
- Child:
- 1:a677037eca0a
V1.0; Created class and basic methods to controll a motor connected to a SDC21XX motor driver
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kkoichy | 0:1c0bc44980e0 | 1 | #ifndef SDC21XX_MOTOR_H |
kkoichy | 0:1c0bc44980e0 | 2 | #define SDC21XX_MOTOR_H |
kkoichy | 0:1c0bc44980e0 | 3 | |
kkoichy | 0:1c0bc44980e0 | 4 | #include "mbed.h" |
kkoichy | 0:1c0bc44980e0 | 5 | #include "Roboteq.h" |
kkoichy | 0:1c0bc44980e0 | 6 | |
kkoichy | 0:1c0bc44980e0 | 7 | namespace mbed { |
kkoichy | 0:1c0bc44980e0 | 8 | |
kkoichy | 0:1c0bc44980e0 | 9 | class SDC21XX_Motor { |
kkoichy | 0:1c0bc44980e0 | 10 | |
kkoichy | 0:1c0bc44980e0 | 11 | public : |
kkoichy | 0:1c0bc44980e0 | 12 | |
kkoichy | 0:1c0bc44980e0 | 13 | SDC21XX_Motor(uint8_t _node_id, CAN * _can, uint8_t _channel, uint32_t _reductor); |
kkoichy | 0:1c0bc44980e0 | 14 | void GoAngle(int16_t _angle); |
kkoichy | 0:1c0bc44980e0 | 15 | int16_t GetAngle(); |
kkoichy | 0:1c0bc44980e0 | 16 | void SetChannel(uint8_t _channel); |
kkoichy | 0:1c0bc44980e0 | 17 | uint8_t GetChannel(void); |
kkoichy | 0:1c0bc44980e0 | 18 | void SetReductor(uint32_t _reductor); |
kkoichy | 0:1c0bc44980e0 | 19 | uint32_t GetReductor(void); |
kkoichy | 0:1c0bc44980e0 | 20 | void SetNodeID(uint8_t _node_id); |
kkoichy | 0:1c0bc44980e0 | 21 | uint8_t GetNodeID(void); |
kkoichy | 0:1c0bc44980e0 | 22 | void SetCan(CAN * _can); |
kkoichy | 0:1c0bc44980e0 | 23 | CAN* GetCan(void); |
kkoichy | 0:1c0bc44980e0 | 24 | |
kkoichy | 0:1c0bc44980e0 | 25 | private : |
kkoichy | 0:1c0bc44980e0 | 26 | |
kkoichy | 0:1c0bc44980e0 | 27 | protected : |
kkoichy | 0:1c0bc44980e0 | 28 | |
kkoichy | 0:1c0bc44980e0 | 29 | Roboteq RB; |
kkoichy | 0:1c0bc44980e0 | 30 | uint8_t channel; |
kkoichy | 0:1c0bc44980e0 | 31 | uint32_t reductor; |
kkoichy | 0:1c0bc44980e0 | 32 | |
kkoichy | 0:1c0bc44980e0 | 33 | |
kkoichy | 0:1c0bc44980e0 | 34 | };//end class |
kkoichy | 0:1c0bc44980e0 | 35 | |
kkoichy | 0:1c0bc44980e0 | 36 | |
kkoichy | 0:1c0bc44980e0 | 37 | |
kkoichy | 0:1c0bc44980e0 | 38 | |
kkoichy | 0:1c0bc44980e0 | 39 | }//end namespace |
kkoichy | 0:1c0bc44980e0 | 40 | |
kkoichy | 0:1c0bc44980e0 | 41 | #endif |