have a recurring event every x seconds

Maybe you want to approach it like this Arduino Playground - EventFuse Library or like that Arduino Playground - MsTimer2 or that Arduino Playground - FlexiTimer2