Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(26)  |  Call(26)  |  Derive(0)  |  Import(0)
Set up and start the PWM channel.  channel can be in the form of 'P8_10', or 'EHRPWM2A'

src/s/m/smokematic-0.1.0/smokematic/blower.py   smokematic(Download)
        self._low_speed_handle = None
 
        PWM.start(blower_pin, 0)
        PWM.stop(blower_pin)
        PWM.cleanup()
        if self._speed < LOW_SPEED and speed > 0:
            # Want to give the fan a full kick to start spinning
            PWM.start(self._blower_pin, 100, PWM_FREQUENCY, 0)
 
            # Only want full speed for 1 second so add a timeout to then set
        """
        if speed > LOW_SPEED:
            PWM.start(self._blower_pin, speed, PWM_FREQUENCY, 0)
        elif speed > 0:
            self._set_low_speed(speed)
        else:
            PWM.start(self._blower_pin, 0, PWM_FREQUENCY, 0)
            timeout_len = period-1
 
        PWM.start(self._blower_pin, 100 if enable_fan else 0, PWM_FREQUENCY, 0)
 
        toggle_partial = functools.partial(

src/a/d/Adafruit_BBIO-0.0.19/test/test_pwm_setup.py   Adafruit_BBIO(Download)
    def test_start_pwm(self):
        PWM.start("P9_14", 0)
 
        files = os.listdir('/sys/devices')
        ocp = '/sys/devices/'+[s for s in files if s.startswith('ocp')][0]
    def test_start_pwm_with_polarity_one(self):
        PWM.start("P9_14", 0, 2000, 1)
 
        files = os.listdir('/sys/devices')
        ocp = '/sys/devices/'+[s for s in files if s.startswith('ocp')][0]
    def test_start_pwm_with_polarity_default(self):
        PWM.start("P9_14", 0, 2000, 0)
 
        files = os.listdir('/sys/devices')
        ocp = '/sys/devices/'+[s for s in files if s.startswith('ocp')][0]
    def test_start_pwm_with_polarity_zero(self):
        PWM.start("P9_14", 0, 2000, 0)
 
        files = os.listdir('/sys/devices')
        ocp = '/sys/devices/'+[s for s in files if s.startswith('ocp')][0]
    def test_pwm_start_invalid_pwm_key(self):
        with pytest.raises(ValueError):   
            PWM.start("P8_25", -1)             
 
    def test_pwm_start_invalid_duty_cycle_negative(self):