Buildable sensor code with scheduler. Not tested