task extensions: periodic call back

Reimplements the power cycle sample using the tools extensions.