Advertisement
belrey10

Day 3: Trials and Allies – Creating Light Patterns

Nov 4th, 2024 (edited)
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. from machine import Pin
  2. import time
  3.  
  4. # Initialize the LEDs
  5. led1 = Pin(13, Pin.OUT)
  6. led2 = Pin(14, Pin.OUT)
  7. led3 = Pin(15, Pin.OUT) # Add more LEDs as needed
  8.  
  9. # Create a simple light pattern
  10. while True:
  11.   led1.on()
  12.   time.sleep(0.5)
  13.   led1.off()
  14.  
  15.   led2.on()
  16.   time.sleep(0.5)
  17.   led2.off()
  18.  
  19.   led3.on()
  20.   time.sleep(0.5)
  21.   led3.off()
  22.  
  23.   time.sleep(0.5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement