当前位置: 首页>>代码示例>>Python>>正文


Python PiGlow.green方法代码示例

本文整理汇总了Python中piglow.PiGlow.green方法的典型用法代码示例。如果您正苦于以下问题:Python PiGlow.green方法的具体用法?Python PiGlow.green怎么用?Python PiGlow.green使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在piglow.PiGlow的用法示例。


在下文中一共展示了PiGlow.green方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: PiGlow

# 需要导入模块: from piglow import PiGlow [as 别名]
# 或者: from piglow.PiGlow import green [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

示例2: sleep

# 需要导入模块: from piglow import PiGlow [as 别名]
# 或者: from piglow.PiGlow import green [as 别名]
 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)
 sleep(0.1)
 
 piglow.yellow(3)
 piglow.green(3)
 sleep(0.1)
 
 piglow.yellow(2)
 piglow.green(4)
 sleep(0.1)
 
开发者ID:shifty051,项目名称:PiGlow,代码行数:32,代码来源:softS.py

示例3: sleep

# 需要导入模块: from piglow import PiGlow [as 别名]
# 或者: from piglow.PiGlow import green [as 别名]
	sleep(0.1)

	#Fade all blue LEDs on
	piglow.blue(51)
	sleep(0.1)
	piglow.blue(102)
	sleep(0.1)
	piglow.blue(153)
	sleep(0.1)
	piglow.blue(204)
	sleep(0.1)
	piglow.blue(255)
	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)
开发者ID:stanleyyork11,项目名称:ProjectPi,代码行数:33,代码来源:pretty.py

示例4: PiGlow

# 需要导入模块: from piglow import PiGlow [as 别名]
# 或者: from piglow.PiGlow import green [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

示例5: PiGlow

# 需要导入模块: from piglow import PiGlow [as 别名]
# 或者: from piglow.PiGlow import green [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

示例6: calculate_intensity

# 需要导入模块: from piglow import PiGlow [as 别名]
# 或者: from piglow.PiGlow import green [as 别名]
    #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)
                                     )
    time.sleep(60)
开发者ID:tommybobbins,项目名称:PiGlow,代码行数:33,代码来源:sunny.py

示例7: sleep

# 需要导入模块: from piglow import PiGlow [as 别名]
# 或者: from piglow.PiGlow import green [as 别名]
  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:
    piglow.white(1)
    sleep(1)

开发者ID:shifty051,项目名称:PiGlow,代码行数:30,代码来源:cpuS.py

示例8: sleep

# 需要导入模块: from piglow import PiGlow [as 别名]
# 或者: from piglow.PiGlow import green [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

示例9: PiGlow

# 需要导入模块: from piglow import PiGlow [as 别名]
# 或者: from piglow.PiGlow import green [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.green方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。