View Single Post
  #3   Spotlight this post!  
Unread 01-10-2009, 05:51 PM
jee7s jee7s is offline
Texan FIRSTer, ex-frc2789, ex-frc41
AKA: Jeffrey Erickson
FRC #6357
 
Join Date: Nov 2007
Rookie Year: 1997
Location: Dripping Springs, TX
Posts: 298
jee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond repute
Re: Programming a relay in C++

Since the enumerated members are in the Relay class, you need

Code:
myRelay.Set(Relay::kForward)
in order to set the proper scope for kForward.

Also, since the constuctor defaults to kBothDirections, you don't need to include that parameter.

So, to initialize a relay object called "r41" on DSC 4 relay channel 1 using the default mode (kBothDirections) and set it forward you'd use:

Code:
Relay r41(4,1);
r41.Set(Relay::kForward);
-Jeff
Reply With Quote