Set pwm values on the controlled pins.

        :param values: Values to set (0.0-1.0).
        :return:
765748
def set_pwm(self, values):
        
        if len(values) != len(self._pins):
            raise ValueError('Number of values has to be identical with '
                             'the number of pins.')
        if not all(0 <= v <= 1 for v in values):
            raise ValueError('Values must be between 0 and 1.')

        for tries in range(self.IO_TRIES):
            try:
                self._set_pwm(self._to_raw_pwm(values))
                break
            except IOError as error:
                if tries == self.IO_TRIES - 1:
                    raise error
        self._state = values
1273669
def setGyroSensitivity(self, value):
        
        try:
            self.i2c_io.write(self.MPU6050_ADDRESS, self.MPU6050_RA_GYRO_CONFIG,
                              {250: 0, 500: 8, 1000: 16, 2000: 24}[value])
            self._gyroFactor = value / 32768.0
            self.gyroSensitivity = value
            logger.debug("Set gyro sensitivity = %d", value)
        except KeyError:
            raise ArgumentError(value + " is not a valid sensitivity (250,500,1000,2000)")
410186
def analog_write(pin, value)
      @pins[pin].value = value
      write(ANALOG_MESSAGE | pin, value & 0x7F, (value >> 7) & 0x7F)
    end
1252740
def _get_pwm_values(self, brightness=None, color=None):
        
        if brightness is None:
            brightness = self.brightness
        if color is None:
            color = self.color

        return [(x / 255) * brightness for x in self._rgb_to_rgbw(color)]
1296426
def set_gpio_pin(self, pin_number, setting, dest_addr_long=None):
        
        assert setting in const.GPIO_SETTINGS.values()
        self._send_and_wait(
            command=const.IO_PIN_COMMANDS[pin_number],
            parameter=setting.value,
            dest_addr_long=dest_addr_long)
386742
def setValuesTyped(self, rows, *values):
        ''
        for r, v in zip(rows, itertools.cycle(self.type(val) for val in values)):
            self.setValueSafe(r, v)
        self.recalc()
        return status('set %d cells to %d values' % (len(rows), len(values)))
1343465
def set_current(self, value):
        '''
        
        '''
        self.current = value
        self.cursor = 0
        self.limit = len(self.current)
        self.limit_backward = 0
        self.bra = self.cursor
        self.ket = self.limit
363491
@Override
    public void setPwm(Pin pin, int duration) {
        int offPosition = calculateOffPositionForPulseDuration(duration);
        setPwm(pin, 0, offPosition);
    }
307861
def set_current_limit(self, value, channel=1):
        
        cmd = "I%d %f" % (channel, value)
        self.write(cmd)
519782
def set_all_pwm(self, on, off):
        """"""
        self.i2c.write8(ALL_LED_ON_L, on & 0xFF)
        self.i2c.write8(ALL_LED_ON_H, on >> 8)
        self.i2c.write8(ALL_LED_OFF_L, off & 0xFF)
        self.i2c.write8(ALL_LED_OFF_H, off >> 8)
1032808
def set_values(self, values, *, index=0):
        
        assert len(self.raw) == 1, \
            'Only devices with 1 light supported'

        return Command('put', self._device.path, {
            ATTR_LIGHT_CONTROL: [
                values
            ]
        })
35257
def set_pulse_width_range(self, min_pulse=750, max_pulse=2250):
        """"""
        self._min_duty = int((min_pulse * self._pwm_out.frequency) / 1000000 * 0xffff)
        max_duty = (max_pulse * self._pwm_out.frequency) / 1000000 * 0xffff
        self._duty_range = int(max_duty - self._min_duty)
80612
@Override
    public void setValue(Pin pin, double value) {

        // validate range
        if(value <= getMinSupportedValue()){
            value =  getMinSupportedValue();
        }
        else if(value >= getMaxSupportedValue()){
            value = getMaxSupportedValue();
        }

        // the DAC only supports integer values between 0..4095
        int write_value = (int)value;
        try {
            // create data packet and seed targeted value
            byte packet[] = new byte[3];
            packet[0] = (byte) MCP4725_REG_WRITEDAC;
            packet[1] = (byte) (write_value >> 4); // Upper data bits (D11.D10.D9.D8.D7.D6.D5.D4)
            packet[2] = (byte) (write_value << 4); // Lower data bits (D3.D2.D1.D0.x.x.x.x)

            // write packet of data to the I2C bus
            device.write(packet, 0, 3);

            // update the pin cache and dispatch any events
            super.setValue(pin, value);
        }
        catch (IOException e) {
            throw new RuntimeException("Unable to write DAC output value.", e);
        }
    }
983521
def __set_values(self, values):
        
        # Tuple of tuples is required
        array = tuple(tuple(self._clean_value(col) for col in row) for row in values)
        self._get_target().setDataArray(array)
709323
def poll_values():
    """"""
    subscription = processor.create_parameter_subscription([
        '/YSS/SIMULATOR/BatteryVoltage1'
    ])

    sleep(5)
    print('Latest value:')
    print(subscription.get_value('/YSS/SIMULATOR/BatteryVoltage1'))

    sleep(5)
    print('Latest value:')
    print(subscription.get_value('/YSS/SIMULATOR/BatteryVoltage1'))
105550
def initialize():
    
    for pin in sorted(OUTPUT_PINS.values()):
        _enable_pin(pin, OUT)

    for pin in sorted(INPUT_PINS.values()):
        _enable_pin(pin, IN)
439545
def update_values(self):
        """"""
        self.method = self.idx_method.currentText()
        sw_det = DetectSlowWave(method=self.method)

        self.index['f1'].set_value(sw_det.det_filt['freq'][0])
        self.index['f2'].set_value(sw_det.det_filt['freq'][1])
        self.index['min_trough_dur'].set_value(sw_det.trough_duration[0])
        self.index['max_trough_dur'].set_value(sw_det.trough_duration[1])
        self.index['max_trough_amp'].set_value(sw_det.max_trough_amp)
        self.index['min_ptp'].set_value(sw_det.min_ptp)
        self.index['min_dur'].set_value(sw_det.min_dur)
        self.index['max_dur'].set_value(sw_det.max_dur)