-------------------------------------------------------------------------------- -- Locals for the application local lastTime = 0 local filename = "Motoraus.wav" --------------------------------------------------------------------------------- -- Runtime functions local function loop() -- Differenzzeit berechnen local newTime = system.getTimeCounter() Sw_Int_val = system.getInputs("SD") if (Sw_Int_val == -1) and (newTime > (lastTime + 10000)) then lastTime = newTime system.playFile(filename, AUDIO_BACKGROUND) end end ------------------------------------------------------------------------- -- Application initialization local function init() lastTime = system.getTimeCounter() end -------------------------------------------------------------------------------- return {init=init, loop=loop, author="user", version="0.1", name= "PreMotOff"}