Beispiel #1
0
class AnalogWrite(Sketch):

    PWM_PIN = 3

    def setup(self):
        self.pwm = AnalogOutput(self.tamp, self.PWM_PIN)
        self.pwm_value = 0
        self.pwm_timer = Timer()

    def loop(self):
        if (self.pwm_timer.millis() > 10):
            self.pwm_timer.reset()
            self.pwm_value = (self.pwm_value + 1) % 256
            self.pwm.write(self.pwm_value)
class AnalogWrite(Sketch):

    PWM_PIN = 3

    def setup(self):
        self.pwm = AnalogOutput(self.tamp, self.PWM_PIN)
        self.pwm_value = 0
        self.pwm_timer = Timer()

    def loop(self):
        if self.pwm_timer.millis() > 10:
            self.pwm_timer.reset()
            self.pwm_value = (self.pwm_value + 1) % 256
            self.pwm.write(self.pwm_value)
Beispiel #3
0
 def setup(self):
     self.pwm = AnalogOutput(self.tamp, self.PWM_PIN)
     self.pwm_value = 0
     self.pwm_timer = Timer()
 def setup(self):
     self.pwm = AnalogOutput(self.tamp, self.PWM_PIN)
     self.pwm_value = 0
     self.pwm_timer = Timer()