소스 검색

Merge 0cf50e9de9 into 2b095c8c77

pull/243/merge
Paul Grimes GitHub 5 년 전
부모
커밋
7e24a69a29
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
1개의 변경된 파일4개의 추가작업 그리고 6개의 파일을 삭제
  1. +4
    -6
      modules/base_plugins/gpio_actor/__init__.py

+ 4
- 6
modules/base_plugins/gpio_actor/__init__.py 파일 보기

@@ -53,14 +53,15 @@ class GPIOPWM(ActorBase):
if self.frequency is None:
self.frequency = 0.5 # 2 sec

self.p = GPIO.PWM(int(self.gpio), float(self.frequency))
if self.p is None:
self.p = GPIO.PWM(int(self.gpio), float(self.frequency))
self.p.start(int(self.power))

def set_power(self, power):
'''
Optional: Set the power of your actor
:param power: int value between 0 - 100
:return:
:return:
'''
if power is not None:
self.power = int(power)
@@ -96,12 +97,9 @@ class Dummy(ActorBase):
'''
Code to switch on the actor
:param power: int value between 0 - 100
:return:
:return:
'''
print "ON"

def off(self):
print "OFF"




불러오는 중...
취소
저장