Example #1
0
 public Task Buzz(float frequency, uint durationMs)
 {
     return(ThreadPool.RunAsync(async(s) =>
     {
         PwmDriver.SetChannelDutyCycle(Config.BuzzerPwmChannel, 0.5f);
         await Task.Delay((int)durationMs);
         PwmDriver.SetChannelDutyCycle(Config.BuzzerPwmChannel, 0.0f);
     }).AsTask());
 }
Example #2
0
        public void SetRightMotorPower(ZumoMotorDirection dir, float power)
        {
            Debug.WriteLine("RightMotor: {0} {1}", dir, power * 100.0f);

            if (dir == ZumoMotorDirection.Forward)
            {
                RightMotorDir.Write(GpioPinValue.Low);
            }
            else
            {
                RightMotorDir.Write(GpioPinValue.High);
            }

            PwmDriver.SetChannelDutyCycle(Config.RightPwmChannel, power);

            rightMotorPower = power;
            rightDir        = dir;
        }