1 #ifndef AVR_CIRCUITNODE_H
2 #define AVR_CIRCUITNODE_H
8 CircuitNode(float V
= 5.0f
, float Z
= 1e3f
) : V(V
), Z(Z
) {}
9 virtual ~CircuitNode() {}
12 float getVoltage() const { return V
; }
13 float getImpendace() const { return Z
; }
14 bool getDigital() const { return V
> 0.25f
; }
24 void setVoltage(float V
);
25 void setImpedance(float Z
);
32 inline void CircuitNode::toggle() {
33 V
= getDigital() ? 0.0f
: 5.0f
;
36 inline void CircuitNode::high() {
40 inline void CircuitNode::low() {
46 #endif /*AVR_CIRCUITNODE_H*/