## 全彩LED灯 ![](https://img.kancloud.cn/08/dd/08dd414d361d7a3158008a8a5616b804_504x330.png) 利用`RGBLED`类来设置全彩LED灯不同的颜色。 ~~~ from gpiozero import RGBLED from time import sleep from __future__ import division # python 2需要 led = RGBLED(red=9, green=10, blue=11) led.red = 1 # full red sleep(1) led.red = 0.5 # half red sleep(1) led.color = (0, 1, 0) # full green sleep(1) led.color = (1, 0, 1) # magenta sleep(1) led.color = (1, 1, 0) # yellow sleep(1) led.color = (0, 1, 1) # cyan sleep(1) led.color = (1, 1, 1) # white sleep(1) led.color = (0, 0, 0) # off sleep(1)