- simplifié mon petit helloworld pour faire clignoter la LED en Lua Script

- ajouté le script pour flasher plus facilement les NodeMCU à la chaîne :-)
This commit is contained in:
Christian Zufferey
2018-10-15 11:47:51 +02:00
parent d69bdab36a
commit 8a0bdde536
4 changed files with 47 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
-- programme pour faire clignoter une LED version simplifiée
print("\n blink_led2.lua zf181015.1138 \n")
zLED=0
gpio.mode(zLED, gpio.OUTPUT)
ztmr_LED = tmr.create()
value = true
tmr.alarm(ztmr_LED, 100, tmr.ALARM_AUTO, function ()
if value then
gpio.write(zLED, gpio.HIGH)
else
gpio.write(zLED, gpio.LOW)
end
value = not value
end)

2
Workshop/README.md Normal file
View File

@@ -0,0 +1,2 @@
# Quelques Workshop sur le NodeMCU

17
blink_led2.lua Normal file
View File

@@ -0,0 +1,17 @@
-- programme pour faire clignoter une LED version simplifiée
print("\n blink_led2.lua zf181015.1138 \n")
zLED=0
gpio.mode(zLED, gpio.OUTPUT)
ztmr_LED = tmr.create()
value = true
tmr.alarm(ztmr_LED, 100, tmr.ALARM_AUTO, function ()
if value then
gpio.write(zLED, gpio.HIGH)
else
gpio.write(zLED, gpio.LOW)
end
value = not value
end)

11
zflash.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
#Petit script pour flasher facilement les NodeMCU
#zf181015.1147
cd ./Tools/esptool-master
python esptool.py erase_flash
sleep
python esptool.py write_flash -fm dio 0x00000 ../../Firmware/nodemcu-master-13-modules-2018-10-11-16-35-53-float.bin
sleep 1
screen /dev/cu.wchusbserial1410 115200