Shouldn't copyright be there too ? (#5200)
[opentx.git] / radio / sdcard / horus / WIDGETS / Counter / main.lua
blob1a68badcfe85413c5d00008b0ef89339fed74776
1 ---- #########################################################################
2 ---- # #
3 ---- # Copyright (C) OpenTX #
4 -----# #
5 ---- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html #
6 ---- # #
7 ---- # This program is free software; you can redistribute it and/or modify #
8 ---- # it under the terms of the GNU General Public License version 2 as #
9 ---- # published by the Free Software Foundation. #
10 ---- # #
11 ---- # This program is distributed in the hope that it will be useful #
12 ---- # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 ---- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 ---- # GNU General Public License for more details. #
15 ---- # #
16 ---- #########################################################################
17 local options = {
18 { "Option1", SOURCE, 1 },
19 { "Option2", VALUE, 1000 },
20 { "Option3", COLOR, RED }
23 local function create(zone, options)
24 local pie = { zone=zone, options=options, counter=0 }
25 print(options.Option2)
26 return pie
27 end
29 local function update(pie, options)
30 pie.options = options
31 end
33 local function background(pie)
34 pie.counter = pie.counter + 1
35 end
37 function refresh(pie)
38 pie.counter = pie.counter + 1
39 lcd.drawNumber(pie.zone.x, pie.zone.y, pie.counter, LEFT + DBLSIZE + TEXT_COLOR);
40 end
42 return { name="Counter", options=options, create=create, update=update, refresh=refresh, background=background }