NodeMCU Projects: Difference between revisions
→Micropython
Line 4:
= Micropython =
== Basics ==
*Installing:
sudo pip install esptool
Line 19 ⟶ 22:
import webrepl
webrepl.start()
*Playing with GPIO:▼
<syntaxhighlight lang="python">▼
import machine▼
pin = machine.Pin(2, machine.Pin.OUT)▼
def toggle(p):▼
p.value(not p.value())▼
toggle(pin)▼
import time▼
while True:▼
time.sleep_ms(500)▼
</syntaxhighlight>▼
for i in range(100,999):▼
*Checking filesystem:
Line 81 ⟶ 51:
print(ap.config('essid'));
== Projects ==
▲*Playing with GPIO:
▲<syntaxhighlight lang="python">
▲ import machine
▲ import time
▲ pin = machine.Pin(2, machine.Pin.OUT)
▲ def toggle(p):
▲ p.value(not p.value())
▲ while True:
▲ for i in range(100,999):
▲</syntaxhighlight>
|