basic motor controller class to be used with the TB6612 motor controller.
motor.h@0:322cf8e3ef05, 2021-10-31 (annotated)
- Committer:
- snapo
- Date:
- Sun Oct 31 10:44:13 2021 +0000
- Revision:
- 0:322cf8e3ef05
initial motor controller class for use in a maze solving robot
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
snapo | 0:322cf8e3ef05 | 1 | #pragma once |
snapo | 0:322cf8e3ef05 | 2 | #include "mbed.h" |
snapo | 0:322cf8e3ef05 | 3 | |
snapo | 0:322cf8e3ef05 | 4 | |
snapo | 0:322cf8e3ef05 | 5 | class motor { |
snapo | 0:322cf8e3ef05 | 6 | DigitalOut dir1_ ; |
snapo | 0:322cf8e3ef05 | 7 | DigitalOut dir2_ ; |
snapo | 0:322cf8e3ef05 | 8 | PwmOut motorOne_ ; |
snapo | 0:322cf8e3ef05 | 9 | |
snapo | 0:322cf8e3ef05 | 10 | public: |
snapo | 0:322cf8e3ef05 | 11 | |
snapo | 0:322cf8e3ef05 | 12 | |
snapo | 0:322cf8e3ef05 | 13 | |
snapo | 0:322cf8e3ef05 | 14 | motor(PinName dir1, PinName dir2, PinName motorOne); |
snapo | 0:322cf8e3ef05 | 15 | |
snapo | 0:322cf8e3ef05 | 16 | void setSpeed (float speed); |
snapo | 0:322cf8e3ef05 | 17 | |
snapo | 0:322cf8e3ef05 | 18 | motor & operator= (float speed); |
snapo | 0:322cf8e3ef05 | 19 | |
snapo | 0:322cf8e3ef05 | 20 | |
snapo | 0:322cf8e3ef05 | 21 | |
snapo | 0:322cf8e3ef05 | 22 | }; |