- totalement remanié la structure de mon dépôt, cela commençait à être trop le foutoire ;-(

This commit is contained in:
Christian Zufferey
2018-11-18 10:36:16 +01:00
parent 3bfc2949d2
commit b2b632a6cd
61 changed files with 56 additions and 1214 deletions

23
Boot init.lua/initz.lua Normal file
View File

@@ -0,0 +1,23 @@
--Script de bootstrap, en appuyant sur le bouton ça démarre start_boot,
-- autrement en attendant 8 secondes cela démarre start_boot
print("\n init.lua zf181017.1026\n")
zswitch=3 --switch flash
gpio.mode(zswitch, gpio.INT, gpio.PULLUP)
initalarme=tmr.create()
function hvbouton()
gpio.trig(zswitch, "none")
tmr.unregister(initalarme)
dofile("start_boot.lua")
-- dofile("start_job.lua")
end
gpio.trig(zswitch, "both", hvbouton)
tmr.alarm(initalarme, 8000, tmr.ALARM_SINGLE, function()
print("\nStart\n")
dofile("start_boot.lua")
-- dofile("start_job.lua")
end)

View File

@@ -0,0 +1,27 @@
-- start.lua
-- programme de start
-- zf180719.1057
do
local zLED=0
local zTm_On_LED = 100 --> en ms
local zTm_Off_LED = 900 --> en ms
local zFlag_LED = 0
local function blink_LED ()
local ztmr_LED = tmr.create()
if zFlag_LED==gpio.LOW then
zFlag_LED=gpio.HIGH
tmr.alarm(ztmr_LED, zTm_Off_LED, tmr.ALARM_SINGLE, blink_LED)
else
zFlag_LED=gpio.LOW
tmr.alarm(ztmr_LED, zTm_On_LED, tmr.ALARM_SINGLE, blink_LED)
end
gpio.write(zLED, zFlag_LED)
end
gpio.mode(zLED, gpio.OUTPUT)
blink_LED ()
end

View File

@@ -0,0 +1,7 @@
-- Scripts à charger au moment du boot
print("\n start_boot.lua zf181017.1021 \n")
dofile("blink_led1.lua")

View File

@@ -0,0 +1,4 @@
-- Permet de démarrer une petite démo simplement via telnet
print("\n start_demo1.lua zf180824.2027 \n")
dofile("oled_disp_multi_lines.lua")

13
Boot init.lua/stop.lua Normal file
View File

@@ -0,0 +1,13 @@
-- stop.lua
-- programme de stop
-- zf180716.0010
zBTN = 3 -- GPIO0 button
zRelay = 6 -- GPIO12 PWM0 relay (active high)
zLED = 7 -- GPIO13 PWM1 GREEN LED (active low)
gpio.mode(zLED,gpio.OUTPUT)
pwm.stop(zLED)
gpio.write(zLED,1)