def interp(self): led = devices.get_out(self.device_name) if not isinstance(led, devices.Led): devices.error('device {} is the wrong type'.format(led)) dc = led.dc freq = led.freq #led.change_frequency(0.5) led.change_frequency(1.0 / self.blink_interval.interp()) led.change_duty_cycle(50) time.sleep(self.blink_interval.interp() * self.number_of_blinks.interp()) led.change_duty_cycle(dc) led.change_frequency(freq) """
def interp(self): servo = devices.get_out(self.device_name) if not isinstance(servo, devices.Servo): devices.error('Device {} is the wrong type'.format(servo)) servo.set_angle(self.val.interp())
def interp(self): led = devices.get_out(self.device_name) if not isinstance(led, devices.Led): devices.error('device {} is the wrong type'.format(led)) led.set(self.val.interp())
def interp(self): light = devices.get_in(self.device_name) if not isinstance(light, devices.LightSensor): devices.error('device {} is the wrong type'.format(button)) light.wait_for_press()
def interp(self): light = devices.get_in(self.device_name) if not isinstance(light, devices.LightSensor): devices.error('device {} is the wrong type'.format(light)) return light.input()
def interp(self): button = devices.get_in(self.device_name) if not isinstance(button, devices.Button): devices.error('device {} is the wrong type'.format(button)) button.wait_for_press()
def interp(self): button = devices.get_in(self.device_name) if not isinstance(button, devices.Button): devices.error('device {} is the wrong type'.format(button)) return button.input()
def interp(self): rgb_led = devices.get_out(self.device_name) if not isinstance(rgb_led, devices.RgbLed): devices.error('device {} is the wrong type'.format(self.device_name)) rgb_led.set_rgb(self.r.interp(), self.g.interp(), self.b.interp())
def interp(self): sensor = devices.get_in(self.device_name) if not isinstance(sensor, devices.TemperatureHumiditySensor): devices.error('device {} is the wrong type'.format(sensor)) return sensor.getHumidity()
def interp(self): fake = devices.get_in(self.device_name) if not isinstance(fake, devices.FakeInput): devices.error('device {} is the wrong type'.format(fake)) return fake.get()