This commit is contained in:
Christian Zufferey
2020-04-16 15:51:02 +02:00
parent f133207709
commit 409f6dae74
5 changed files with 82 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
-- Scripts à charger après le boot pour démarrer son projet
print("\n boot.lua zf200229.2303 \n")
print("\n boot.lua zf200303.1409 \n")
function boot()
verbose = true
@@ -11,10 +11,10 @@ function boot()
--zurl=thingspeak_url.."field1="..tostring(ztemp1).."&field2="..tostring(zhum1)
--f="0_send_data.lua" if file.exists(f) then dofile(f) end
f="0_btn_flipflop.lua" if file.exists(f) then dofile(f) end
f = "0_zdyndns.lua" if file.exists(f) then dofile(f) end
f="0_cron.lua" if file.exists(f) then dofile(f) end
f="0_tst3_socat.lua" if file.exists(f) then dofile(f) end
--f="0_tst3_socat.lua" if file.exists(f) then dofile(f) end
--f = "web_ide2.lua" if file.exists(f) then dofile(f) end
print("verbose:",verbose)

View File

@@ -1,4 +1,4 @@
-- Petit script pour configurer le client WIFI du NodeMCU
print("\n wifi_cli_conf.lua zf200302.2353 \n")
print("\n wifi_cli_conf.lua zf200303.1533 \n")
wifi.sta.config{ssid="NodeMCU btn 3a:2b:78:04:2d:2d", pwd="12345678", save=true}

View File

@@ -0,0 +1,16 @@
a=0.5
b=3
print(a*b)
print(a+b)
c=a*b
print("la valeur de c est: ",c)
gpio.mode(0,gpio.OUTPUT)
if c>=3 then
gpio.write(0,0)
else
gpio.write(0,1)
end

View File

@@ -0,0 +1,24 @@
-- Programme qui allume la led bleue quand on appuie le bouton flash
-- zf181011.1749
print("\n btn_led.lua zf200302.2356 \n")
zledbleue=0 --led bleue
zswitch=3 --switch flash
gpio.mode(zswitch, gpio.INT, gpio.PULLUP)
function zbtn()
if gpio.read(zswitch)==0 then
zled_state="ON"
gpio.write(zledbleue, gpio.LOW)
else
zled_state="OFF"
gpio.write(zledbleue, gpio.HIGH)
end
print("btn_led: "..zled_state)
--disp_send()
end
gpio.trig(zswitch, "both", zbtn)

38
zflash-epfl.sh Normal file
View File

@@ -0,0 +1,38 @@
#!/bin/bash
#Petit script pour flasher facilement les NodeMCU avec un firmware
#ATTENTION: c'est pour ma structure, il faudra donc l'adapter
#zf191231.1746
#test si l'argument est vide
if [ -z "$1" ]
then
echo -e "\nSyntax:
Pour le dernier firmware à la mode:
./zflash.sh ../../Firmware/nodemcu-master-16-modules-2019-12-01-22-17-07-float.bin
./zflash.sh ../../Firmware/nodemcu-master-11-modules-2019-12-15-16-45-47-float.bin
./zflash.sh ../../Firmware/nodemcu-master-18-modules-2019-12-17-20-28-32-float.bin
./zflash.sh ../../Firmware/nodemcu-master-12-modules-2019-12-21-11-05-58-float.bin
./zflash.sh ../../Firmware/nodemcu-master-19-modules-2019-12-31-16-40-12-float.bin
Pour l'ancien qui supporte encore le DS18B20:
./zflash.sh ../../Firmware/nodemcu-master-20-modules-2019-06-01-12-50-39-float.bin
"
exit
fi
echo ---------- start zflash.sh
cd ./Tools/esptool-master
python3 esptool.py erase_flash
sleep 2
python3 esptool.py write_flash -fm dio 0x00000 $1
sleep 2
screen /dev/cu.wchusbserial1420 115200