Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/lib/support/drivers/boton.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lib/support/drivers/boton.lua')
-rw-r--r--lib/support/drivers/boton.lua19
1 files changed, 0 insertions, 19 deletions
diff --git a/lib/support/drivers/boton.lua b/lib/support/drivers/boton.lua
deleted file mode 100644
index 4f846c9..0000000
--- a/lib/support/drivers/boton.lua
+++ /dev/null
@@ -1,19 +0,0 @@
-local device = _G
-
-local GET_VALUE=string.char(0x00)
-local string_byte=string.byte
-
--- description: lets us know button's current status
--- input: empty
--- output: button's current status. Possible status: 1 pressed - 0 not pressed
-api={}
-api.getValue = {}
-api.getValue.parameters = {} -- no input parameters
-api.getValue.returns = {[1]={rname="state", rtype="int"}}
-api.getValue.call = function ()
- device:send(GET_VALUE) -- operation code 1 = get button's status
- local sen_dig_response = device:read(2) -- 2 bytes to read (opcode, data)
- if not sen_dig_response or #sen_dig_response~=2 then return -1 end
- local raw_val = string_byte(sen_dig_response, 2) or 0 -- keep data
- return raw_val
-end