Download the file
  1. #ifndef DIGITAL_OUTPUT_H
  2. #define DIGITAL_OUTPUT_H
  3.  
  4. class DigitalOutput {
  5. public:
  6. DigitalOutput(uint8_t pin):
  7. pin(pin) {
  8. pinMode(pin, OUTPUT);
  9. }
  10. inline void high() const { digitalWrite(pin, HIGH); }
  11. inline void low() const { digitalWrite(pin, LOW); }
  12.  
  13. protected:
  14. const uint8_t pin;
  15.  
  16. };
  17. #endif
  18. // vim:ft=arduino
  19.