CSharpRoboticsLib.WPIExtensions.SpeedControllerGroup.Set C# (CSharp) Method

Set() public method

Sets the output value for these speed controllers
public Set ( double value ) : void
value double
return void
        public void Set(double value)
        {
            foreach (ISpeedController s in m_controllers)
                s.Set(value);
        }

Same methods

SpeedControllerGroup::Set ( double value, byte syncGroup ) : void

Usage Example

        public static void TestSet()
        {
            using (Talon t1 = new Talon(0), t2 = new Talon(1), t3 = new Talon(2))
            {
                SpeedControllerGroup s = new SpeedControllerGroup(t1, t2, t3);
                s.Set(1);
                for (int i = 0; i < 3; i++)
                    Assert.AreEqual(1, SimData.PWM[i].Value, 0.01);

                s.Set(0);
                for (int i = 0; i < 3; i++)
                    Assert.AreEqual(0, SimData.PWM[i].Value, 0.01);
            }
        }
All Usage Examples Of CSharpRoboticsLib.WPIExtensions.SpeedControllerGroup::Set