當前位置: 首頁>>代碼示例>>Python>>正文


Python PiGlow.yellow方法代碼示例

本文整理匯總了Python中piglow.PiGlow.yellow方法的典型用法代碼示例。如果您正苦於以下問題:Python PiGlow.yellow方法的具體用法?Python PiGlow.yellow怎麽用?Python PiGlow.yellow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在piglow.PiGlow的用法示例。


在下文中一共展示了PiGlow.yellow方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: sleep

# 需要導入模塊: from piglow import PiGlow [as 別名]
# 或者: from piglow.PiGlow import yellow [as 別名]
 
 piglow.red(4)
 piglow.orange(2)
 sleep(0.1)
 
 piglow.red(3)
 piglow.orange(3)
 sleep(0.1)
 
 piglow.red(2)
 piglow.orange(4)
 sleep(0.1)
 
 piglow.red(1)
 piglow.orange(3)
 piglow.yellow(1)
 sleep(0.1)
 
 piglow.red(0)
 piglow.orange(2)
 piglow.yellow(2)
 sleep(0.1)
 
 piglow.orange(1)
 piglow.yellow(3)
 piglow.green(1)
 sleep(0.1)
 
 piglow.orange(0)
 piglow.yellow(4)
 piglow.green(2)
開發者ID:shifty051,項目名稱:PiGlow,代碼行數:33,代碼來源:softS.py

示例2: PiGlow

# 需要導入模塊: from piglow import PiGlow [as 別名]
# 或者: from piglow.PiGlow import yellow [as 別名]
#!/usr/bin/python
from piglow import PiGlow
# yellow
piglow = PiGlow()
piglow.white(0)
piglow.blue(0)
piglow.green(0)
piglow.yellow(100)
piglow.orange(0)
piglow.red(0)
開發者ID:AdamOssenford,項目名稱:piglow,代碼行數:12,代碼來源:yellow.py

示例3: file

# 需要導入模塊: from piglow import PiGlow [as 別名]
# 或者: from piglow.PiGlow import yellow [as 別名]
else: #no pid file exists, lets go ahead and run
    file(pidfile, 'w').write(pid)

while 1:

    cpu = psutil.cpu_percent(interval=0.5)
    piglow.all(0)

    if cpu <= 10:
        piglow.green(1)
    elif cpu >= 11 and cpu <= 20:
        piglow.green(2)
    elif cpu >= 21 and cpu <= 30:
        piglow.green(3)
    elif cpu >= 31 and cpu <= 40:
        piglow.green(4)
    elif cpu >= 41 and cpu <= 50:
        piglow.yellow(5)
    elif cpu >= 51 and cpu <= 60:
        piglow.yellow(6)
    elif cpu >= 61 and cpu <= 70:
        piglow.yellow(7)
    elif cpu >= 71 and cpu <= 80:
        piglow.yellow(8)
    elif cpu >= 81 and cpu <= 90:
        piglow.red(9)
    elif cpu >= 91:
        piglow.red(10)
    else:
        piglow.green(1)
開發者ID:jussiroberts,項目名稱:Raspberry-Pi-PiGlow-project,代碼行數:32,代碼來源:cpuloadz.py

示例4: PiGlow

# 需要導入模塊: from piglow import PiGlow [as 別名]
# 或者: from piglow.PiGlow import yellow [as 別名]
#!/usr/bin/env python
from piglow import PiGlow
piglow = PiGlow()
piglow.yellow(255)
開發者ID:x41x41x90,項目名稱:x41-piglow,代碼行數:6,代碼來源:yellow.py

示例5: PiGlow

# 需要導入模塊: from piglow import PiGlow [as 別名]
# 或者: from piglow.PiGlow import yellow [as 別名]
piglow = PiGlow()

while True:

    cpu = psutil.cpu_percent()
    piglow.all(0)

    if cpu < 5:
        piglow.white(20)
    elif cpu < 20:
        piglow.white(20)
        piglow.blue(20)
    elif cpu < 40:
        piglow.white(20)
        piglow.blue(20)
        piglow.green(20)
    elif cpu < 60:
        piglow.white(20)
        piglow.blue(20)
        piglow.green(20)
        piglow.yellow(20)
    elif cpu < 80:
        piglow.white(20)
        piglow.blue(20)
        piglow.green(20)
        piglow.yellow(20)
        piglow.orange(20)
    else:
        piglow.all(20)
    sleep(0.2)
開發者ID:ElectroMisfit,項目名稱:PiGlow,代碼行數:32,代碼來源:cpu.py

示例6: sleep

# 需要導入模塊: from piglow import PiGlow [as 別名]
# 或者: from piglow.PiGlow import yellow [as 別名]
	sleep(0.1)

	#Fade all green LEDs on
	piglow.green(51)
	sleep(0.1)
	piglow.green(102)
	sleep(0.1)
	piglow.green(153)
	sleep(0.1)
	piglow.green(204)
	sleep(0.1)
	piglow.green(255)
	sleep(0.1)
	
	#Fade all yellow LEDs on
	piglow.yellow(51)
	sleep(0.1)
	piglow.yellow(102)
	sleep(0.1)
	piglow.yellow(153)
	sleep(0.1)
	piglow.yellow(204)
	sleep(0.1)
	piglow.yellow(255)
	sleep(0.1)
	
	#Fade all orange LEDs on
	piglow.orange(51)
	sleep(0.1)
	piglow.orange(102)
	sleep(0.1)
開發者ID:stanleyyork11,項目名稱:ProjectPi,代碼行數:33,代碼來源:pretty.py

示例7: PiGlow

# 需要導入模塊: from piglow import PiGlow [as 別名]
# 或者: from piglow.PiGlow import yellow [as 別名]
#!/usr/bin/python
from piglow import PiGlow
# orange
piglow = PiGlow()
piglow.white(0)
piglow.blue(0)
piglow.green(0)
piglow.yellow(0)
piglow.orange(100)
piglow.red(0)
開發者ID:AdamOssenford,項目名稱:piglow,代碼行數:12,代碼來源:orange.py

示例8: PiGlow

# 需要導入模塊: from piglow import PiGlow [as 別名]
# 或者: from piglow.PiGlow import yellow [as 別名]
from piglow import PiGlow
from time import sleep

piglow = PiGlow()

print("You will now be asked how bright you would like each LED to be, choose a number between 0 and 255")
sleep(3)
val1 = input("White: ")
val2 = input("Blue: ")
val3 = input("Green: ")
val4 = input("Yellow: ")
val5 = input("Orange: ")
val6 = input("Red: ")
delay = input("How long is the delay between flashes? :")

while True:
    piglow.white(val1)
    sleep(delay)
    piglow.blue(val2)
    sleep(delay)
    piglow.green(val3)
    sleep(delay)
    piglow.yellow(val4)
    sleep(delay)
    piglow.orange(val5)
    sleep(delay)
    piglow.red(val6)
    sleep(delay)
    piglow.all(0)
開發者ID:lesp,項目名稱:PiGlow_Examples,代碼行數:31,代碼來源:piglow_cycleLED.py

示例9: calculate_intensity

# 需要導入模塊: from piglow import PiGlow [as 別名]
# 或者: from piglow.PiGlow import yellow [as 別名]
    intensity['blue'] += calculate_intensity(norm_noon_diff,centre,0.09,255)
    #print ("White")
    intensity['white'] = calculate_intensity(norm_noon_diff,centre,0.07,64)

    total_intensity = 0
    for key in intensity:
        if (intensity[key] > 255):
            intensity[key] = 255
        else:
            intensity[key] = int(round(intensity[key]))
        total_intensity += intensity[key]
#        print ("Key = %s, value = %i\n" % (key, intensity[key]))

    piglow.red(intensity['red']) 
    piglow.orange(intensity['orange']) 
    piglow.yellow(intensity['yellow']) 
    piglow.green(intensity['green']) 
    piglow.blue(intensity['blue']) 
    piglow.white(intensity['white']) 


#   Condensed logging for graphing purposes (time, followed by the colours)
    logging.info("%i %i %i %i %i %i %i %i" %(epoch_now,
                                      intensity['red'],
                                      intensity['orange'],
                                      intensity['yellow'],
                                      intensity['green'],
                                      intensity['blue'],
                                      intensity['white'],
                                      total_intensity)
                                     )
開發者ID:tommybobbins,項目名稱:PiGlow,代碼行數:33,代碼來源:sunny.py

示例10:

# 需要導入模塊: from piglow import PiGlow [as 別名]
# 或者: from piglow.PiGlow import yellow [as 別名]
while True:
  
  cpu = psutil.cpu_percent()
  piglow.all(0)

  if cpu < 5:
    piglow.red(10)

  elif cpu < 20:
    piglow.red(1)
    piglow.orange(1)

  elif 20 < cpu < 49:
    piglow.red(1)
    piglow.orange(1)
    piglow.yellow(1)

  elif cpu < 60:
    piglow.red(1)
    piglow.orange(1)
    piglow.yellow(1)
    piglow.green(1)

  elif cpu < 80:
    piglow.red(10)
    piglow.orange(1)
    piglow.yellow(1)
    piglow.green(1)
    piglow.blue(1)

  else:
開發者ID:shifty051,項目名稱:PiGlow,代碼行數:33,代碼來源:cpuS.py

示例11: sleep

# 需要導入模塊: from piglow import PiGlow [as 別名]
# 或者: from piglow.PiGlow import yellow [as 別名]
while True:

    cpu = psutil.cpu_percent()
    piglow.all(0)

    if cpu < 1:
        piglow.white(0)
    elif cpu < 10:
        piglow.white(5)
    elif cpu < 20:
        piglow.white(10)
        piglow.blue(20)
    elif cpu < 40:
        piglow.white(10)
        piglow.blue(35)
        piglow.green(35)
    elif cpu < 60:
        piglow.white(20)
        piglow.blue(40)
        piglow.green(40)
        piglow.yellow(40)
    elif cpu < 80:
        piglow.white(20)
        piglow.blue(40)
        piglow.green(40)
        piglow.yellow(40)
        piglow.orange(100)
    else:
        piglow.all(20)
    sleep(0.2)
開發者ID:mikebratt,項目名稱:PiGlow,代碼行數:32,代碼來源:cpu.py

示例12: PiGlow

# 需要導入模塊: from piglow import PiGlow [as 別名]
# 或者: from piglow.PiGlow import yellow [as 別名]
######################################################
## Set each colour to a brightness of your choosing ##
##                                                  ##
## Example by Jason - @Boeeerb                      ##
######################################################

from piglow import PiGlow

piglow = PiGlow()

val = input("White: ")
piglow.white(val)

val = input("Blue: ")
piglow.blue(val)

val = input("Green: ")
piglow.green(val)

val = input("Yellow: ")
piglow.yellow(val)

val = input("Orange: ")
piglow.orange(val)

val = input("Red: ")
piglow.red(val)

val = input("All: ")
piglow.all(val)
開發者ID:AlexanderHems,項目名稱:PiGlow,代碼行數:32,代碼來源:test.py


注:本文中的piglow.PiGlow.yellow方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。