- 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:
17
Workshop/181015/blink_led2.lua
Normal file
17
Workshop/181015/blink_led2.lua
Normal 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
2
Workshop/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# Quelques Workshop sur le NodeMCU
|
||||
|
||||
17
blink_led2.lua
Normal file
17
blink_led2.lua
Normal 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
11
zflash.sh
Executable 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
|
||||
Reference in New Issue
Block a user