1 ---- #########################################################################
3 ---- # Copyright (C) OpenTX #
5 ---- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html #
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. #
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. #
16 ---- #########################################################################
18 { "Option1", SOURCE
, 1 },
19 { "Option2", VALUE
, 1000 },
20 { "Option3", COLOR
, RED
},
24 local function create(zone
, options
)
25 local pie
= { zone
=zone
, options
=options
, counter
=0 }
26 print(options
.Option2
)
30 local function update(pie
, options
)
34 local function background(pie
)
35 pie
.counter
= pie
.counter
+ 1
39 pie
.counter
= pie
.counter
+ 1
40 if pie
.options
.Shadow
== 1 then
41 lcd
.drawNumber(pie
.zone
.x
, pie
.zone
.y
, pie
.counter
, LEFT
+ DBLSIZE
+ TEXT_COLOR
);
43 lcd
.drawNumber(pie
.zone
.x
, pie
.zone
.y
, pie
.counter
, LEFT
+ DBLSIZE
+ TEXT_COLOR
+ SHADOWED
);
47 return { name
="Counter", options
=options
, create
=create
, update
=update
, refresh
=refresh
, background
=background
}