myRGB2 = RGB(pins2)

print("go")

while True:
    myRGB1.red()
    myRGB2.green()
    time.sleep(delay)
    myRGB1.green()
    myRGB2.red()
    time.sleep(delay)
    myRGB1.blue()
    myRGB2.cyan()
    time.sleep(delay)
    myRGB1.cyan()
    myRGB2.blue()
    time.sleep(delay)
    myRGB1.magenta()
    myRGB2.yellow()
    time.sleep(delay)
    myRGB1.yellow()
    myRGB2.magenta()
    time.sleep(delay)
    myRGB1.white()
    myRGB2.white()
    time.sleep(delay)
    myRGB1.black()
    myRGB2.black()
    time.sleep(delay)
    myRGB1.rainbow()
    myRGB2.rainbow()
Пример #2
0
import time
import board  #pylint: disable-msg=import-error
from rgb import RGB

r = board.D2
g = board.D3
b = board.D4

myRGB = RGB(r, g, b)

print("go")

while True:
    myRGB.red()
    time.sleep(0.1)
    myRGB.green()
    time.sleep(0.1)
    myRGB.blue()
    time.sleep(0.1)
    myRGB.cyan()
    time.sleep(0.1)
    myRGB.magenta()
    time.sleep(0.1)
    myRGB.yellow()
    time.sleep(0.1)
    myRGB.white()
    time.sleep(0.1)
    myRGB.black()
    time.sleep(0.1)
    myRGB.rainbow()