average ldr readings and skip reading while logging to db