gt911 - gt911 Drive#

Adaptation status unknown

Note

This page document is automatically generated by this file. If there is any error, please submit issue or help modify pr, thank you!

Example

--Note: due to the use of sys.wait() all apis need to be used in the coroutine
-- Usage Examples
local gt911 = require "gt911"

local i2cid = 0
local gt911_res = pin.PA07
local gt911_int = pin.PA00
i2c_speed = i2c.FAST
sys.taskInit(function()
    i2c.setup(i2cid,i2c_speed)
    gt911.init(i2cid,gt911_res,gt911_int)
    while 1 do
        sys.wait(1000)
    end
end)

local function gt911CallBack(press_sta,i,x,y)
    print(press_sta,i,x,y)
end

sys.subscribe("GT911",gt911CallBack)

gt911.init(gt911_i2c,gt911_res,gt911_int)#

gt911 Initialization

Parameters

Incoming Value Type

Explanation

number

gt911_i2c i2c_id

number

gt911_res Reset Pin

number

gt911_int Interrupt Pin

Return Value

return value type

explanation

bool

Successful return true

Examples

gt911.init(0)