![]() |
Programming a relay in C++
How do you do it? this is probably too general a question, but we just started using C++ for this build season, and we're pretty inexperienced. So we need to know how to properly initialize it, and just basically how to do it. sorry if that's not a good explanation, or if the subject is too broad.
|
Re: Programming a relay in C++
In this season's code, you would do the following:
Code:
Relay myRelay([slot],[chanel],kBothDirections); //initialize the relay in slot [slot], channel [channel], and allow it to move both directionsIf this isn't enough detail, just say so. |
Re: Programming a relay in C++
Since the enumerated members are in the Relay class, you need
Code:
myRelay.Set(Relay::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); |
| All times are GMT -5. The time now is 10:12 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi