Ejemplo n.º 1
0
        private async void btnInitialize_Click(object sender, RoutedEventArgs e)
        {
            if (LightningProvider.IsLightningEnabled)
            {
                LowLevelDevicesController.DefaultProvider = LightningProvider.GetAggregateProvider();
            }

            gpioController = await GpioController.GetDefaultAsync();

            if (gpioController == null)
            {
                return;
            }

            pwmControllers = await PwmController.GetControllersAsync(LightningPwmProvider.GetPwmProvider());

            if (pwmControllers == null)
            {
                return;
            }
            LeftMotor = new MotorControl(gpioController, pwmControllers[1]);
            LeftMotor.Initialize(LEFTINA, LEFTINB, LEFTPWM);
            RightMotor = new MotorControl(gpioController, pwmControllers[1]);
            RightMotor.Initialize(RIGHTINA, RIGHTINB, RIGHTPWM);
        }
Ejemplo n.º 2
0
 public CameraViewModel(IMotorControl motorControl,IHornControl hornControl,IBrakeControl brakeControl)
 {
     _hornControl = hornControl;
     _motorControl = motorControl;
     _brakeControl = brakeControl;
     SpeedFeedback.PropertyChanged += (s,e) => { RaisePropertyChanged("speed");};
     DirectionFeedback.PropertyChanged += (s, e) => { RaisePropertyChanged("direction_angle"); };
     motorKeys = new List<Key>() {Key.W,Key.A,Key.S,Key.D};
 }
Ejemplo n.º 3
0
 public CameraViewModel(IMotorControl motorControl, IHornControl hornControl, IBrakeControl brakeControl)
 {
     _hornControl  = hornControl;
     _motorControl = motorControl;
     _brakeControl = brakeControl;
     SpeedFeedback.PropertyChanged     += (s, e) => { RaisePropertyChanged("speed"); };
     DirectionFeedback.PropertyChanged += (s, e) => { RaisePropertyChanged("direction_angle"); };
     motorKeys = new List <Key>()
     {
         Key.W, Key.A, Key.S, Key.D
     };
 }
Ejemplo n.º 4
0
 public MotorDriveCommand(IMotorControl drivable)
 {
     _drivable = drivable;
 }
Ejemplo n.º 5
0
 public SpeechInterpretation(IMotorControl motorControl,IHeadlightControl headlightControl,IHornControl hornControl)
 {
     _motorControl = motorControl;
     _headlightControl = headlightControl;
     _hornControl = hornControl;
 }
Ejemplo n.º 6
0
 public SpeechInterpretation(IMotorControl motorControl, IHeadlightControl headlightControl, IHornControl hornControl)
 {
     _motorControl     = motorControl;
     _headlightControl = headlightControl;
     _hornControl      = hornControl;
 }
Ejemplo n.º 7
0
 void Start()
 {
     controller = MotorController.GetInstance();
 }