//this example with use the graphics functions to write to the values of the ADCs to the Remote screen #include "svt.h" //declare some variables to use: int mVolts; int lastmVolts; int LMC; int lastLMC; int RMC; int lastRMC; void Start() { //take contro of the display: OpenGraphics(); } bool Run() { //Check if it's time to quit if (GetRemoteKeys() & KEY_HOME) return false; // read values of ADCs: LMC=GetLeftMotorCurrent(); RMC=GetRightMotorCurrent(); mVolts=GetBatteryVoltage(); //if values have changed:Update screen if (LMC!=lastLMC || RMC!=lastRMC||mVolts!=lastmVolts) { //clear graphcs buffer: ClearScreen(); //load the buffer with some new drawing instructions: DrawText(5,5,"Battery: %d mV", mVolts); //the voltage appears in place of '%d' DrawText(5,25,"Motor current"); DrawText(5,45,"in miliampres"); DrawText(5,65,"left: %d", LMC); DrawText(85,65,"right: %d", RMC); //Update buffer to screen: Show(); //reset "last" values: lastLMC=LMC; lastRMC=RMC; lastmVolts=mVolts; } //if no change, wait a little while before checking again: else { Sleep(100); } return true; } void End() { CloseGraphics(); }