--[[
ģƣάɲʾĻ
ģ޸ʱ䣺2017.11.10
]]

module(...,package.seeall)

--LCDֱʵĿȺ͸߶(λ)
WIDTH,HEIGHT = disp.getlcdinfo()

--- qrencode.encode(string) άϢ
-- @param string άַ
-- @return width ɵĶάϢ
-- @return data ɵĶά
-- @usage local width, data = qrencode.encode("http://www.openluat.com")
local width, data = qrencode.encode('http://www.openluat.com')

--- disp.putqrcode(data, width, display_width, x, y) ʾά
-- @param data qrencode.encodeصĶά
-- @param width άݵʵʿ
-- @param display_width άʵʾ,ʾȿҪ
-- @param x άʾʼx
-- @param y άʾʼy

--- άʾ
local function appQRCode()
	disp.clear()
	disp.drawrect(0, 0, WIDTH-1, HEIGHT-1, WHITE)
	local displayWidth = 100
	disp.putqrcode(data, width, displayWidth, (WIDTH-displayWidth)/2, (HEIGHT-displayWidth)/2)
	disp.update()
end

appQRCode()
