This method configures the Arduino for servo operation.

        :param pin: Servo control pin

        :param min_pulse: Minimum pulse width

        :param max_pulse: Maximum pulse width

        :returns: No return value
330509
def servo_config(self, pin, min_pulse=544, max_pulse=2400):
        
        task = asyncio.ensure_future(self.core.servo_config(pin, min_pulse,
                                                            max_pulse))
        self.loop.run_until_complete(task)
780575
def _update_pwm(self):
        """"""
        if self._is_on:
            values = self._get_pwm_values()
        else:
            values = [0] * len(self._driver.pins)

        self._driver.set_pwm(values)
108522
def _min(self, memory, addr, **kwargs):
        
        return memory.state.solver.min(addr, exact=kwargs.pop('exact', self._exact), **kwargs)
1271020
def setMinimum(self, minimum):
        
        if not isinstance(minimum, int):
            raise TypeError("Argument is not of type int or long")
        self._minimum = minimum
915447
def set_range(self, min_val, max_val):
        
        if min_val > max_val:
            max_val, min_val = min_val, max_val
        self.values = (((self.values * 1.0 - self.values.min()) /
                        (self.values.max() - self.values.min()))
                       * (max_val - min_val) + min_val)
358316
def get_gpio_pin(self, pin_number, dest_addr_long=None):
        
        frame = self._send_and_wait(
            command=const.IO_PIN_COMMANDS[pin_number],
            dest_addr_long=dest_addr_long
        )
        value = frame["parameter"]
        return const.GPIO_SETTINGS[value]
992845
def set_pwm(self, led_num, value):
        
        self.__check_range('led_number', led_num)
        self.__check_range('led_value', value)

        register_low = self.calc_led_register(led_num)

        self.write(register_low, value_low(value))
        self.write(register_low + 1, value_high(value))
170363
function PIDController(options)
{
    // Options configuration
    this.opts       = {
        Kp         : 1.0,
        Ki         : 0.0,
        Kd         : 0.0,
        round      : true,
        Ts         : 1000,  // In MS. (Old sampleTime)
        uMin       : 0,
        uMax       : 255
    };

    options         = options || {};
    this.opts       = extend({}, this.opts, options);

    // Internal Use variables
    this.input           = function ()
    {
        // Function (Reading from sensor)
        this.setIVal(0);
    };

    this.direction       = 0;     // 0 = forward, 1 = drop down to and go forward, 3 = reverse
    this.duration        = 1;     // In seconds (How long to run - 0 = infinite)

    this.output          = function (val)
    {
        // Function (Writing to device)
        return val;
    };

    this.e          = [0.00, 0.00];
    this.PV         = [0.00, 0.00, 0.00];
    this.CO         = [0.00, 0.00];
    this.interval   = 0;
    this.iVal       = 0;
    this.running    = false;
    this.startTime  = 0;
    this.duration   = 0;
    this.SP         = 0;
    this.t1         = 0;
    this.timeLeft   = 0;
    this.tReached   = false;

    EventEmitter.call(this);
}
401552
def serial_lock(self, lock):
        ''''''
        mav = self.master.mav
        if lock:
            flags = mavutil.mavlink.SERIAL_CONTROL_FLAG_EXCLUSIVE
            self.locked = True
        else:
            flags = 0
            self.locked = False
        mav.serial_control_send(self.serial_settings.port,
                                flags,
                                0, 0, 0, [0]*70)
510165
def clamp(min, max)
      value = self
      value = [value, min].max if min
      value = [value, max].min if max
      value
    end
1022771
def _input_pins(self, pins):
        
        [self._validate_channel(pin) for pin in pins]
        # Get GPIO state.
        gpio = self.i2c.read_list(self.GPIO, self.gpio_bytes)
        # Return True if pin's bit is set.
        return [(gpio[int(pin/8)] & 1 << (int(pin%8))) > 0 for pin in pins]
416334
def set_mode(mode)
      raise UnsupportedModeError unless @onboard_pin.supported_modes.include?(mode)
      @board.set_pin_mode(@number, mode) unless current_mode == mode
    end
243632
def _set_pwm(self, raw_values):
        
        for i in range(len(self._pins)):
            self._pi.set_PWM_dutycycle(self._pins[i], raw_values[i])
363491
@Override
    public void setPwm(Pin pin, int duration) {
        int offPosition = calculateOffPositionForPulseDuration(duration);
        setPwm(pin, 0, offPosition);
    }
1290503
def begin(self):
        
        # Assert CS pin low for a second for PN532 to be ready.
        self._gpio.set_low(self._cs)
        time.sleep(1.0)
        # Call GetFirmwareVersion to sync up with the PN532.  This might not be
        # required but is done in the Arduino library and kept for consistency.
        self.get_firmware_version()
        self._gpio.set_high(self._cs)
119807
def _write4bits(self, value):
        """"""
        for i in range(4):
            bit = (value >> i) & 0x01
            GPIO.output(self.pins[i + 7], bit)
        self._pulse_enable()
1345577
async def _poll_gpio(self, poll, interval=10):
        
        if poll and self._gpio_task is None:
            async def polling_routine(interval):
                """Poll GPIO state every @interval seconds."""
                while True:
                    try:
                        pios = None
                        ret = await self._wait_for_cmd(
                            OTGW_CMD_REPORT, OTGW_REPORT_GPIO_STATES)
                        if ret:
                            pios = ret[2:]
                            status = {
                                OTGW_GPIO_A_STATE: int(pios[0]),
                                OTGW_GPIO_B_STATE: int(pios[1]),
                            }
                            self._update_status(status)
                        await asyncio.sleep(interval)
                    except asyncio.CancelledError:
                        status = {
                            OTGW_GPIO_A_STATE: 0,
                            OTGW_GPIO_B_STATE: 0,
                        }
                        self._update_status(status)
                        self._gpio_task = None
                        break
            self._gpio_task = self.loop.create_task(polling_routine(interval))
        elif not poll and self._gpio_task is not None:
            self._gpio_task.cancel()