Exemple #1
0
        /// <summary>
        /// Create the PWM pin, set it low and configure timings
        /// </summary>
        /// <param name="pin"></param>
        public Servo(Cpu.Pin pin)
        {
            // Init the PWM pin
            // servo = new PWM((Cpu.Pin)pin);
            
            servo = new PWM((Cpu.PWMChannel)pin, 10000, 0.1, false);
            servo.Period((uint)0); 
            servo.SetDutyCycle(0);

            // Typical settings
            range[0] = 1000;
            range[1] = 2000;

            // jha v1.2
            forwardRange = 100;
            reverseRange = -100;
        }