-------------------------------- Variablen ------------------------------------------------------ local appName="Timer Vorlage" local min = 0 local sec = 0 local std = 0 local time = 0 local value = 0 local newTime, stmsek, minmsek local startTimer = 0 local saveTime = 0 ----------------------------- Timer berechnen -------------------------------------------------- local function printTime() time = system.getTimeCounter()-startTimer value = math.abs(time) ----------------------------------- Flugzeit --------------------------------------------------- ------- Stunden std = math.floor(value/3600000) ------- Minuten stmsek = std*3600000 min = math.floor(((value-stmsek)/1000)/60) ------- Sekunden minmsek = math.floor((value-stmsek)/1000) sek = minmsek-(min*60) ----------------------------- Bildschirmausgabe -------------------------------------------------- lcd.drawText((110 - lcd.getTextWidth(FONT_MAXI,std))/2,40,std,FONT_MAXI) lcd.drawText((260 - lcd.getTextWidth(FONT_MAXI,min))/2,40,min,FONT_MAXI) lcd.drawText((410 - lcd.getTextWidth(FONT_MAXI,sek))/2,40,sek,FONT_MAXI) end --------------------------------- Init ---------------------------------------------------------- local function init() startTimer = system.getTimeCounter() system.registerTelemetry(2,"Vorlage Timer -- Flugsachen.de",4,printTime); collectgarbage() end ------------------------------------------------------------------------------------------------- return { init=init, loop=loop, author="Flugsachen.de", version="1.00",name=appName}