Grove module for two DC moto.

TwoWheelSimple.h 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. Copyright (C) 2016 Wesley Tsai ([email protected])
  3. Permission is hereby granted, free of charge, to any person obtaining a copy of
  4. this software and associated documentation files (the "Software"), to deal in
  5. the Software without restriction, including without limitation the rights to
  6. use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  7. the Software, and to permit persons to whom the Software is furnished to do so,
  8. subject to the following conditions:
  9. The above copyright notice and this permission notice shall be included in all
  10. copies or substantial portions of the Software.
  11. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  13. FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  14. COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  15. IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  16. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  17. */
  18. /*
  19. * Library for controlling two TT moto of DC 3v-12v.
  20. *
  21. * Information about the makercup obtained from:
  22. * https://medium.com/maker-cup
  23. */
  24. #ifndef __TwoWheelSimple_h__
  25. #define __TwoWheelSimple_h__
  26. #include "Arduino.h"
  27. class TwoWheelSimple
  28. {
  29. public:
  30. TwoWheelSimple(byte MotoPinL, byte MotoPinR);
  31. ~TwoWheelSimple();
  32. void init();
  33. void forward(void);
  34. void backward(void);
  35. void stop(void);
  36. private:
  37. byte _MotoPinL;
  38. byte _MotoPinR;
  39. };
  40. #endif