Exemple #1
0
        public static void Main()
        {
            //var aaa = new Class1();
            //aaa.TestX();

            using (var transmitter = new Transmitter())
            {
                //Firts vehiclle
                //var receiverTrain = new Receiver(transmitter, Channel.Ch1);
                //var motor = new Motor(receiverTrain.RedConnector);
                //var light = new Led(receiverTrain.RedConnector);

                //Rover on another channel
                var receiverRover = new Receiver(transmitter, Channel.Ch2);
                var drive         = new Motor(receiverRover.BlueConnector);
                var steeringWheel = new Servo(receiverRover.RedConnector);

                //Now Control
                while (true)
                {
                    //motor.IncSpeed();
                    //light.TurnOn();

                    drive.SetSpeed(100);
                    steeringWheel.SetAngle180(45);

                    Thread.Sleep(1000);

                    steeringWheel.Center();
                    //motor.Brake();

                    //light.TurnOff();
                }
            }
        }