#include "svt.h" // Always int RunCounter=1; // variable to store numbr of Run() calls int RemoteState; // integer to store RemoteState() into int LastRemoteState; // remember the last to compare to int secondCount=1; // counting seconds passed void Start() { ResetTimer(); Log("Starting..."); //The first line of the "A://Test/Trakr.log" } bool Run() { //Check if it's time to quit if (GetRemoteKeys() & KEY_HOME) return false; //note as the seconds pass if (ReadTimer() >= secondCount*1000) { Log("%d Seconds", secondCount); secondCount+=1; } // Log when the Remote Keys Change RemoteState=GetRemoteKeys(); if (LastRemoteState!=RemoteState){ Log("Run count %d, Remote state: %d", RunCounter, RemoteState); LastRemoteState=RemoteState; } // Check if time is up if (ReadTimer()>5000) { Log("Time is up"); return false; } // Wait a moment and then increment the run count before going again Sleep(10); RunCounter+=1; return true; } void End() { //On last Log Entry Log("Signing off."); }