예제 #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);
        }
예제 #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};
 }
예제 #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
     };
 }
예제 #4
0
 public MotorDriveCommand(IMotorControl drivable)
 {
     _drivable = drivable;
 }
예제 #5
0
 public SpeechInterpretation(IMotorControl motorControl,IHeadlightControl headlightControl,IHornControl hornControl)
 {
     _motorControl = motorControl;
     _headlightControl = headlightControl;
     _hornControl = hornControl;
 }
예제 #6
0
 public SpeechInterpretation(IMotorControl motorControl, IHeadlightControl headlightControl, IHornControl hornControl)
 {
     _motorControl     = motorControl;
     _headlightControl = headlightControl;
     _hornControl      = hornControl;
 }
예제 #7
0
 void Start()
 {
     controller = MotorController.GetInstance();
 }