Treehopper C++ API
DigitalOut.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Treehopper.h"
4 #include "Event.h"
5 
6 namespace Treehopper {
11  public:
13  virtual void makePushPullOutput() = 0;
14 
16  virtual bool digitalValue() {
17  return _digitalValue;
18  }
19 
21  virtual void digitalValue(bool value) {
22  if (_digitalValue == value) return;
23 
24  _digitalValue = value;
25  writeOutputValue();
26  }
27 
28  protected:
29  bool _digitalValue;
30 
31  virtual void writeOutputValue() = 0;
32  };
33 }
virtual bool digitalValue()
Retrieve the currently-set digital value of the pin.
Definition: DigitalOut.h:16
virtual void digitalValue(bool value)
Set the pin's digital value.
Definition: DigitalOut.h:21
Digital output pin abstract class.
Definition: DigitalOut.h:10
Definition: AdcPin.h:3
#define TREEHOPPER_API
Definition: Treehopper.h:17