Library for controlling Robot via I2C.

I2CRobot.h 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. Copyright (C) 2016 Wesley Tsai (wesleyboy42@gmail.com)
  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 robot via I2C.
  20. *
  21. * Information about the makercup obtained from:
  22. * https://medium.com/maker-cup
  23. */
  24. #ifndef __I2CRobot_h__
  25. #define __I2CRobot_h__
  26. #include "Arduino.h"
  27. class I2CRobot
  28. {
  29. public:
  30. I2CRobot(byte ID);
  31. ~I2CRobot();
  32. void init(void);
  33. void hello(void);
  34. void order(void);
  35. void check(void);
  36. void custom(byte custom);
  37. private:
  38. byte _ID=8;
  39. byte _hello=254;
  40. byte _order=253;
  41. byte _check=252;
  42. };
  43. #endif