Quote:
Originally Posted by de_
The class description seems to hint that we need to declare 2 relays on the SAME channel,
- one with forward only (line 1) control
Relay m_relay1(1, Relay::KForwardOnly);
- and one with reverse only (line 2).
Relay m_relay2(1, RElay::kReverseOnly);
And then we can control each line relay individually.
|
This will cause an exception because relay 1 will be allocated twice.
Quote:
Originally Posted by de_
Or do you declare a single relay and change the direction to access a specific line on the fly like
Relay m_relay(1);
:
m_relay.SetDirection(Relay::kForwardOnly); // access 1 line of the spike
m_relay.Set(Relay::kOn) ; // set On or Off 1st line
m_relay.SetDirection(Relay::kReverseOnly); // access 2nd line
m_relay.Set(Relay::kOn); // set On or Off 2nd line....
:
Sorry last coding I did was on an RC 
|
With this code, whenever the relay is set to ForwardOnly, the reverse will be off, and vice versa.