0% found this document useful (0 votes)
2 views1 page

Control Multiple LEDs with Python Code

The document contains a Python script for controlling a series of 10 LEDs using a microcontroller. It initializes each LED pin as an output and then enters an infinite loop that sequentially turns each LED on for 250 milliseconds before turning it off. This creates a visual effect of the LEDs lighting up one after the other.

Uploaded by

Andres Rojas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Control Multiple LEDs with Python Code

The document contains a Python script for controlling a series of 10 LEDs using a microcontroller. It initializes each LED pin as an output and then enters an infinite loop that sequentially turns each LED on for 250 milliseconds before turning it off. This creates a visual effect of the LEDs lighting up one after the other.

Uploaded by

Andres Rojas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

import machine

import time

arsled1 =[Link](15, [Link])

arsled2 =[Link](2, [Link])

arsled3 =[Link](4, [Link])

arsled4 =[Link](16, [Link])

arsled5 =[Link](17, [Link])

arsled6 =[Link](5, [Link])

arsled7 =[Link](18, [Link])

arsled8 =[Link](19, [Link])

arsled9 =[Link](21, [Link])

arsled10 =[Link](3, [Link])

arsled = [arsled1, arsled2, arsled3, arsled4, arsled5, arsled6, arsled7,


arsled8, arsled9, arsled10]

while True:

for contador in range(10):

arsled[contador].on()

time.sleep_ms(250)

arsled[contador].off()

You might also like