Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/lib/support/drivers/move.lua
blob: 7c361e3c754b2b9d5beb03c83a853c433ee21c1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
local device = _G
local GET_MOVE = string.char(0x01)
local char000 = string.char(0,0,0)

api={}
api.get_move = {}
api.get_move.parameters = {} --no parameter
api.get_move.returns = {[1]={rname="digital_value", rtype="number"}} --one return
api.get_move.call = function ()
	local get_move_payload = GET_MOVE 
	device:send(get_move_payload)
	local move_response = device:read(2) or char000
	local raw_val = (string.byte(move_response, 2) or 0)
	return raw_val
end