Пример #1
0
        public InstructorOnDeviceGoPiGo()
        {
            _goPiGo.MotorController().SetLeftMotorSpeed(10);
            _goPiGo.MotorController().SetRightMotorSpeed(10);

            _goPiGo = DeviceFactory.Build.BuildGoPiGo();
        }
 internal MotorController(IGoPiGo goPiGo)
 {
     if (goPiGo == null)
     {
         throw new ArgumentNullException(nameof(goPiGo));
     }
     GoPiGo = goPiGo;
 }
Пример #3
0
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            _deferral = taskInstance.GetDeferral();

            _goPiGo = DeviceFactory.Build.BuildGoPiGo();

            _timer = ThreadPoolTimer.CreatePeriodicTimer(TurnLeftGoForward, TimeSpan.FromSeconds(10));
        }
Пример #4
0
 internal Sensor(IGoPiGo device, Pin pin)
 {
     if (device == null)
     {
         throw new ArgumentNullException(nameof(device));
     }
     Device = device;
     Pin    = pin;
 }
Пример #5
0
 internal Sensor(IGoPiGo device, Pin pin, PinMode pinMode)
 {
     if (device == null)
     {
         throw new ArgumentNullException(nameof(device));
     }
     device.PinMode(Pin, pinMode);
     Device = device;
     Pin    = pin;
 }
Пример #6
0
 public MainPage()
 {
     GoPiGo = DeviceFactory.BuildGoPiGo();
     GoPiGo.MotorController().EnableServo();
     _leftLed  = DeviceFactory.BuildLed(Pin.LedLeft);
     _rightLed = DeviceFactory.BuildLed(Pin.LedRight);
     this.InitializeComponent();
     Stopwatch = new Stopwatch();
     Stopwatch.Start();
 }
Пример #7
0
 public MainPage()
 {
     GoPiGo = DeviceFactory.BuildGoPiGo();
     GoPiGo.MotorController().EnableServo();
     _leftLed = DeviceFactory.BuildLed(Pin.LedLeft);
     _rightLed = DeviceFactory.BuildLed(Pin.LedRight);
     this.InitializeComponent();
     Stopwatch = new Stopwatch();
     Stopwatch.Start();
 }
Пример #8
0
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            _deferral = taskInstance.GetDeferral();

            _goPiGo = DeviceFactory.Build.BuildGoPiGo();

            _goPiGo.MotorController().EnableServo();

            SocketConnection.StartListener();
            SocketConnection.NewMessageReady += SendCommand;
        }
Пример #9
0
        public MainPage()
        {
            InitializeComponent();

            _goPiGo = DeviceFactory.Build.BuildGoPiGo();

            _goPiGo.MotorController().EnableServo();

            _devices = DeviceFactory.Build.BuildUltraSonicSensor(Pin.Trigger);

            System.Diagnostics.Debug.WriteLine("Start Listener");
            ServerSocketConnection.StartListener();
            ServerSocketConnection.NewMessageReady += SendCommand;

            Loaded += MainPage_Loaded;
        }
Пример #10
0
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            random  = new Random();
            _goPiGo = _deviceFactory.BuildGoPiGo();
            _goPiGo.MotorController().EnableServo();
            var analogSensor = _deviceFactory.BuildUltraSonicSensor(Pin.Analog1);
            var test         = analogSensor.MeasureInCentimeters();

            _goPiGo.MotorController().RotateServo(125);
            _goPiGo.MotorController().RotateServo(50);
            _goPiGo.MotorController().RotateServo(-90);

            //_goPiGo.EncoderController().EnableEncoders();
            //var test2 = _goPiGo.EncoderController().ReadEncoder(Motor.MotorOne);

            _goPiGo.MotorController().MoveForward();
        }
Пример #11
0
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            random = new Random();
            _goPiGo = _deviceFactory.BuildGoPiGo();
            _goPiGo.MotorController().EnableServo();
            var analogSensor = _deviceFactory.BuildUltraSonicSensor(Pin.Analog1);
            var test =analogSensor.MeasureInCentimeters();

            _goPiGo.MotorController().RotateServo(125);
            _goPiGo.MotorController().RotateServo(50);
            _goPiGo.MotorController().RotateServo(-90);

            //_goPiGo.EncoderController().EnableEncoders();
            //var test2 = _goPiGo.EncoderController().ReadEncoder(Motor.MotorOne);

            _goPiGo.MotorController().MoveForward();
        }
Пример #12
0
 public Led(IGoPiGo device, Pin pin) : base(device, pin, PinMode.Output)
 {
 }
Пример #13
0
 public MainPage()
 {
     this.InitializeComponent();
     GoPiGo = DeviceFactory.BuildGoPiGo();
     GoPiGo.MotorController().EnableServo();
 }
Пример #14
0
 internal MotorController(IGoPiGo goPiGo)
 {
     if (goPiGo == null) throw new ArgumentNullException(nameof(goPiGo));
     GoPiGo = goPiGo;
 }
Пример #15
0
 public CommandParser(IGoPiGo goPiGo, ILed leftLed, ILed rightLed)
 {
     _goPiGo = goPiGo;
     _leftLed = leftLed;
     _rightLed = rightLed;
 }
Пример #16
0
 public CommandParser(IGoPiGo goPiGo, ILed leftLed, ILed rightLed)
 {
     _goPiGo   = goPiGo;
     _leftLed  = leftLed;
     _rightLed = rightLed;
 }
Пример #17
0
 internal Led(IGoPiGo device, Pin pin) : base(device, pin, PinMode.Output)
 {
 }