Motor Shield Example code for 2.74 Class @ MIT
Dependents: experiment_example motor_shield_example Lab3_experiment_example jumping_leg_clicky
MotorShield.h@3:2f46953e7c8b, 2020-08-26 (annotated)
- Committer:
- elijahsj
- Date:
- Wed Aug 26 02:43:57 2020 +0000
- Revision:
- 3:2f46953e7c8b
- Parent:
- 1:4c3c2b7337a6
- Child:
- 5:d2dffc88e94d
finished shield code;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
elijahsj | 0:f2ede00aed8a | 1 | /* Library to interface with 2.74 Motor Shield |
elijahsj | 3:2f46953e7c8b | 2 | ** Uses low level HAL libraries to enable high speed PWM |
elijahsj | 0:f2ede00aed8a | 3 | */ |
elijahsj | 0:f2ede00aed8a | 4 | |
elijahsj | 0:f2ede00aed8a | 5 | class MotorShield { |
elijahsj | 0:f2ede00aed8a | 6 | |
elijahsj | 0:f2ede00aed8a | 7 | public: |
elijahsj | 0:f2ede00aed8a | 8 | |
elijahsj | 3:2f46953e7c8b | 9 | MotorShield(int periodTicks); |
elijahsj | 3:2f46953e7c8b | 10 | void motorAWrite(double duty_cycle, int direction); |
elijahsj | 3:2f46953e7c8b | 11 | void motorBWrite(double duty_cycle, int direction); |
elijahsj | 3:2f46953e7c8b | 12 | void motorCWrite(double duty_cycle, int direction); |
elijahsj | 3:2f46953e7c8b | 13 | void motorDWrite(double duty_cycle, int direction); |
elijahsj | 3:2f46953e7c8b | 14 | void changePeriod(int periodTicks); |
elijahsj | 0:f2ede00aed8a | 15 | |
elijahsj | 0:f2ede00aed8a | 16 | private: |
elijahsj | 0:f2ede00aed8a | 17 | |
elijahsj | 3:2f46953e7c8b | 18 | int periodTickVal; |
elijahsj | 3:2f46953e7c8b | 19 | void init(); |
elijahsj | 0:f2ede00aed8a | 20 | |
elijahsj | 0:f2ede00aed8a | 21 | }; |
elijahsj | 0:f2ede00aed8a | 22 |