Download the file
  1. #ifndef RELAY_H
  2. #define RELAY_H
  3.  
  4. #include <Ports.h>
  5.  
  6. #define RELAY_OPEN 0
  7. #define RELAY_CLOSED 1
  8.  
  9. class Relay {
  10. public:
  11. Relay();
  12. void open();
  13. void close();
  14. uint8_t get_state();
  15. private:
  16. uint8_t state;
  17. Port port;
  18. };
  19.  
  20. #endif
  21. // vim:ft=arduino
  22.