소스 검색

moved pin declaration and misc. comments

Abhinav Sinha 10 년 전
부모
커밋
c710e31c93
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 0
      BUILD/init.lua
  2. 2 4
      BUILD/interrupt.lua

+ 4 - 0
BUILD/init.lua

@@ -17,6 +17,10 @@ SUCCESS_SETUP_TIMER = 5
 YO_RECIPIENT = nil
 API_KEY = nil
 
+buttonPin = 6 -- GPIO12
+ledPin = 2 --GPIO4
+
+
 print("3 second startup delay using timer " .. STARTUP_DELAY_TIMER .. '...')
 tmr.alarm(STARTUP_DELAY_TIMER, 3000, 0, function ()
   print("Starting.")

+ 2 - 4
BUILD/interrupt.lua

@@ -1,6 +1,4 @@
--- using timer 5 for short/long press detection
 local longPress = 3000 -- 3 seconds
-local buttonPin = 6 -- GPIO6
 
 function shortOrLongPress()
   local level = gpio.read(buttonPin)
@@ -25,8 +23,8 @@ function shortOrLongPress()
 end
 
 function debounce (func)
-  local last = 0
-  local delay = 200000
+  local last = 0 --units: microseconds
+  local delay = 200000 --units: microseconds
 
   return function (...)
     local now = tmr.now()