Selaa lähdekoodia

Merge 510154b911 into 2b095c8c77

pull/220/merge
Alexander Solncev GitHub 6 vuotta sitten
vanhempi
commit
c8f66fb3c9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 muutettua tiedostoa jossa 5 lisäystä ja 5 poistoa
  1. +5
    -5
      modules/base_plugins/gpio_actor/__init__.py

+ 5
- 5
modules/base_plugins/gpio_actor/__init__.py Näytä tiedosto

@@ -44,16 +44,16 @@ class GPIOPWM(ActorBase):
def init(self):
GPIO.setup(int(self.gpio), GPIO.OUT)
GPIO.output(int(self.gpio), 0)
if self.frequency is None:
self.frequency = 0.5 # 2 sec

self.p = GPIO.PWM(int(self.gpio), float(self.frequency))


def on(self, power=None):
if power is not None:
self.power = int(power)

if self.frequency is None:
self.frequency = 0.5 # 2 sec

self.p = GPIO.PWM(int(self.gpio), float(self.frequency))
print "GPIO ON"
self.p.start(int(self.power))

def set_power(self, power):


Loading…
Peruuta
Tallenna