from machine import Pin
import time
r = Pin(18, Pin.OUT)
g = Pin(19, Pin.OUT)
b = Pin(1, Pin.OUT)
T = 1000000
uklj1 = T
isklj1 = T
uklj2 = T
isklj2 = T
uklj3 = T
isklj3 = T
while True:
while (uklj1 <= 1.9 * T and isklj1 >= 0.1 * T) and (uklj2 <= 1.9 * T and isklj2 >= 0.1 * T) and (uklj3 <= 1.9 * T and isklj3 >= 0.1 * T):
r.value(1)
time.sleep_us(int(uklj1))
r.value(0)
time.sleep_us(int(isklj1))
g.value(1)
time.sleep_us(int(uklj2))
g.value(0)
time.sleep_us(int(isklj2))
b.value(1)
time.sleep_us(int(uklj3))
b.value(0)
time.sleep_us(int(isklj3))
uklj1 += T / 30.0
isklj1 -= T / 30.0
uklj2 += T / 30.0
isklj2 -= T / 30.0
uklj3 += T / 30.0
isklj3 -= T / 30.0
while (uklj1 >= 0.1 * T and isklj1 <= 1.9 * T) and (uklj2 >= 0.1 * T and isklj2 <= 1.9 * T) and (uklj3 >= 0.1 * T and isklj3 <= 1.9 * T):
r.value(1)
time.sleep_us(int(uklj1))
r.value(0)
time.sleep_us(int(isklj1))
g.value(1)
time.sleep_us(int(uklj2))
g.value(0)
time.sleep_us(int(isklj2))
b.value(1)
time.sleep_us(int(uklj3))
b.value(0)
time.sleep_us(int(isklj3))
uklj1 -= T / 30.0
isklj1 += T / 30.0
uklj2 -= T / 30.0
isklj2 += T / 30.0
uklj3 -= T / 30.0
isklj3 += T / 30.0