From 8a0bdde53617cc9f84ff7cad63b26fc6d13c186f Mon Sep 17 00:00:00 2001 From: Christian Zufferey Date: Mon, 15 Oct 2018 11:47:51 +0200 Subject: [PATCH] =?UTF-8?q?-=20simplifi=C3=A9=20mon=20petit=20helloworld?= =?UTF-8?q?=20pour=20faire=20clignoter=20la=20LED=20en=20Lua=20Script=20-?= =?UTF-8?q?=20ajout=C3=A9=20le=20script=20pour=20flasher=20plus=20facileme?= =?UTF-8?q?nt=20les=20NodeMCU=20=C3=A0=20la=20cha=C3=AEne=20:-)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Workshop/181015/blink_led2.lua | 17 +++++++++++++++++ Workshop/README.md | 2 ++ blink_led2.lua | 17 +++++++++++++++++ zflash.sh | 11 +++++++++++ 4 files changed, 47 insertions(+) create mode 100644 Workshop/181015/blink_led2.lua create mode 100644 Workshop/README.md create mode 100644 blink_led2.lua create mode 100755 zflash.sh diff --git a/Workshop/181015/blink_led2.lua b/Workshop/181015/blink_led2.lua new file mode 100644 index 0000000..70fa251 --- /dev/null +++ b/Workshop/181015/blink_led2.lua @@ -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) diff --git a/Workshop/README.md b/Workshop/README.md new file mode 100644 index 0000000..e4de6f2 --- /dev/null +++ b/Workshop/README.md @@ -0,0 +1,2 @@ +# Quelques Workshop sur le NodeMCU + diff --git a/blink_led2.lua b/blink_led2.lua new file mode 100644 index 0000000..70fa251 --- /dev/null +++ b/blink_led2.lua @@ -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) diff --git a/zflash.sh b/zflash.sh new file mode 100755 index 0000000..255ab21 --- /dev/null +++ b/zflash.sh @@ -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