-
Notifications
You must be signed in to change notification settings - Fork 0
/
LED.py
38 lines (31 loc) · 1.35 KB
/
LED.py
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
35
36
37
38
------------------------------------------BLOG POST #1------------------------------------------------------------
# Hello world, The below are MicroPython codes which are tested on ESP 8266 V.3. All details are mentioned at clevertronics.blogspot.com
#Turn LED on
# Hello world, The below are MicroPython codes which are tested on ESP 8266 V.3. All details are mentioned at clevertronics.blogspot.com
#Turn LED ON
import machine
pin = machine.Pin(2, machine.Pin.OUT)
pin.on()
------------------------------------------BLOG POST #1------------------------------------------------------------
# Hello world, The below are MicroPython codes which are tested on ESP 8266 V.3. All details are mentioned at clevertronics.blogspot.com
#Blink with Delay
import machine
import time
pin = machine.Pin(2, machine.Pin.OUT)
while True:
pin.on()
time.sleep(0.5)
pin.off()
time.sleep(0.5)
-----------------------------------------BLOG POST #2------------------------------------------------------
# Hello world, The below are MicroPython codes which are tested on ESP 8266 V.3. All details are mentioned at clevertronics.blogspot.com
#Blink custom number of times
import machine
import time
pin = machine.Pin(2, machine.Pin.OUT)
n=int(input("Enter the number of Blinks you need : "))
for i in range(n):
pin.off()
time.sleep(0.5)
pin.on()
time.sleep(0.5)