Commit 0f7fadd59992f67bee3faf016e6571f7b121db87

Authored by Thomas R. Koll
1 parent c1f0a0bebb
Exists in master

Fix some bugs

Showing 2 changed files with 6 additions and 6 deletions Side-by-side Diff

... ... @@ -3,7 +3,7 @@
3 3 super_mario_count = 0
4 4  
5 5 local disp = require("display")
6   -local disp.setup()
  6 +disp.setup()
7 7 local timer_id = 3
8 8 local timer_mqtt_id = 4
9 9  
10 10  
11 11  
... ... @@ -35,12 +35,12 @@
35 35  
36 36 function change_count_on_input(pin, direction)
37 37 gpio.mode(pin, gpio.INT)
38   - gpi.trig(pin, "both", debounce(
  38 + gpio.trig(pin, "both", debounce(
39 39 function (level)
40   - if(level == gpio.high) then
  40 + if level == gpio.high then
41 41 change_super_mario_count(direction)
42 42 end
43   - end
  43 + end)
44 44 )
45 45 end
46 46  
... ... @@ -9,7 +9,7 @@
9 9 function debounce (func, delay)
10 10 local last = 0
11 11 -- 50ms * 1000 as tmr.now() has μs resolution
12   - local delay = if delay then delay else 50000 end
  12 + local delay = delay or 50000
13 13  
14 14 return function (...)
15 15 local now = tmr.now()