Skip to content

Commit 2bc28ed

Browse files
author
Jefe21054(Ivan)
committed
First program MicroPython
1 parent 8d9b7ba commit 2bc28ed

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

blink.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import machine
2+
import time
3+
4+
led_pin = machine.Pin(2, machine.Pin.OUT) # Pin 2 controls the onboard LED
5+
6+
while True:
7+
led_pin.value(1) # Turn on the LED
8+
time.sleep(0.5) # Wait for half a second
9+
led_pin.value(0) # Turn off the LED
10+
time.sleep(0.5) # Wait for half a second

boot.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This file is executed on every boot (including wake-boot from deepsleep)
2+
#import esp
3+
#esp.osdebug(None)
4+
import uos, machine
5+
#uos.dupterm(None, 1) # disable REPL on UART(0)
6+
import gc
7+
#import webrepl
8+
#webrepl.start()
9+
gc.collect()

0 commit comments

Comments
 (0)