-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLED_Chaser_Program.py
More file actions
34 lines (26 loc) · 1.09 KB
/
Copy pathLED_Chaser_Program.py
File metadata and controls
34 lines (26 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'''Hello friends I am Aman Yadav.
This program only for initialization of a LED and turn it on.
you can watch video tutorial on youTube - www.youtube.com/martianiot for full course of "MicroPython Tutorial in hindi"
follow me on instagrame "amanyadav.io" to be updated with my all techPost :)
'''
from machine import Pin # Here I have imported Pin class from machine module.
from time import sleep # In this line I have imported sleep class form time module.
Red_LED=Pin(14,Pin.OUT) # Initialization of Red_LED
Green_LED=Pin(12,Pin.OUT) # Initialization of Green_LED
Yellow_LED=Pin(4,Pin.OUT) # Initialization of Yellow_LED
Red_LED.value(0) # Make low all pins where leds are connected
Green_LED.value(0)
Yellow_LED.value(0)
while True:
Red_LED.value(1) # Turn On Each LEDs after 0.5 second
Green_LED.value(0)
Yellow_LED.value(0)
sleep(0.5)
Red_LED.value(0)
Green_LED.value(1)
Yellow_LED.value(0)
sleep(0.5)
Red_LED.value(0)
Green_LED.value(0)
Yellow_LED.value(1)
sleep(0.5)