Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## 1 led blinkin random loop
- from gpiozero import LED
- from time import sleep
- ## random function
- import random
- red_led = LED(17)
- while True:
- ## defined two variables that change value at each loop
- light_on = random.random()
- light_off = random.random()
- ## printing the random numbers
- print(light_on)
- print(light_off)
- ## here's the led blinking using the variables
- red_led.blink(light_on, light_off)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement