本文整理匯總了Python中piglow.PiGlow.arm1方法的典型用法代碼示例。如果您正苦於以下問題:Python PiGlow.arm1方法的具體用法?Python PiGlow.arm1怎麽用?Python PiGlow.arm1使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類piglow.PiGlow
的用法示例。
在下文中一共展示了PiGlow.arm1方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: PiGlow
# 需要導入模塊: from piglow import PiGlow [as 別名]
# 或者: from piglow.PiGlow import arm1 [as 別名]
#Google Analytics to PiGlow LEDS
from piglow import PiGlow
import time
import urllib2
piglow = PiGlow()
#Test
i = 0
while (i < 2):
piglow.arm1(127)
time.sleep(0.1)
piglow.arm1(0)
piglow.arm2(127)
time.sleep(0.1)
piglow.arm2(000)
piglow.arm3(127)
time.sleep(0.1)
piglow.arm3(0)
#Test Completed
i = i+1
while True:
response = urllib2.urlopen('http://ryanteck.org.uk/nginx_status')
html = response.read()
data = html.split('\n')
active = data[0].split(":")
count = active[1]
count = int(count) -1;
#print(count)
if(count ==0):
piglow.all(0)
示例2: PiGlow
# 需要導入模塊: from piglow import PiGlow [as 別名]
# 或者: from piglow.PiGlow import arm1 [as 別名]
from config import email, password, mail
from piglow import PiGlow
## Init the current device
piglow = PiGlow()
## Device parameters
piglow.all(0)
if mail == 0:
print "no mail"
piglow.all(0)
sleep(0.5)
elif mail < 5:
print "mail count low"
piglow.arm1(10)
sleep(0.5)
elif mail < 10:
print "mail count medium"
piglow.arm1(10)
piglow.arm2(10)
sleep(0.5)
elif mail < 15:
print "mail count high"
piglow.arm1(10)
piglow.arm2(10)
piglow.arm3(10)
sleep(0.5)
else:
print "too many emails"
for x in range(0, 10):
示例3: sleep
# 需要導入模塊: from piglow import PiGlow [as 別名]
# 或者: from piglow.PiGlow import arm1 [as 別名]
sleep(0.1)
piglow.arm3(2)
sleep(0.1)
piglow.arm3(3)
piglow.arm2(1)
sleep(0.1)
piglow.arm3(2)
piglow.arm2(2)
sleep(0.1)
piglow.arm3(1)
piglow.arm2(3)
piglow.arm1(1)
sleep(0.1)
piglow.arm3(0)
piglow.arm2(2)
piglow.arm1(2)
sleep(0.1)
piglow.arm2(1)
piglow.arm1(3)
piglow.arm3(1)
sleep(0.1)
piglow.arm2(0)
piglow.arm1(2)
piglow.arm3(2)
示例4: sleep
# 需要導入模塊: from piglow import PiGlow [as 別名]
# 或者: from piglow.PiGlow import arm1 [as 別名]
#Red off
piglow.red(204)
sleep(0.1)
piglow.red(153)
sleep(0.1)
piglow.red(102)
sleep(0.1)
piglow.red(51)
sleep(0.1)
piglow.red(0)
sleep(0.1)
###Arm fade on
#Arm1 fade on
piglow.arm1(51)
sleep(0.1)
piglow.arm1(102)
sleep(0.1)
piglow.arm1(153)
sleep(0.1)
piglow.arm1(204)
sleep(0.1)
piglow.arm1(255)
sleep(0.1)
#Arm2 fade on
piglow.arm2(51)
sleep(0.1)
piglow.arm2(102)
sleep(0.1)