Beispiel #1
0
        public async Task Init()
        {
            Debug.WriteLine("Initializing ZumoMotorShield");

            Debug.WriteLine(Config.ToString());

            var gpioCtrlr = GpioController.GetDefault();

            LeftMotorDir = gpioCtrlr.OpenPin(Config.LeftMotorDirPin);
            Debug.Assert(LeftMotorDir != null);

            RightMotorDir = gpioCtrlr.OpenPin(Config.RightMotorDirPin);
            Debug.Assert(RightMotorDir!= null);

            LeftMotorDir.SetDriveMode(GpioPinDriveMode.Output);
            RightMotorDir.SetDriveMode(GpioPinDriveMode.Output);

            PwmDriver = new PCA9685(Config.PwmDriverSlaveAddress);

            await PwmDriver.Init();
        }