Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass

JeffersGlass/gpio_dimming.py Secret

Created Aug 30, 2020
Embed
What would you like to do?
from gpiozero import PWMLED
from time import sleep
redLed = PWMLED(20)
yellowLed = PWMLED(21)
dimmingLevel = 0
yellowLed.pulse(fade_in_time = 2, fade_out_time=.5)
while True:
dimmingLevel += 0.01
if dimmingLevel > 1: dimmingLevel = 0
redLed.value = dimmingLevel
sleep(.05)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.