private void Stop() { status = WebServer.STATUS_STOPPED; if (controller != null) { controller.CmdExecutor.Stop(); controller.TurnOff(); controller = null; } }
static void Main(string[] args) { var roomba = new RoombaController(); var result = roomba.Connect(); roomba.SwitchToFullMode(); roomba.Drive(300, 2001); roomba.Disconnect(); }
public void OnCommandDispatched(int code) { switch (code) { case WebServer.CODE_START: if (status != WebServer.STATUS_DRIVING) { Debug.Print("Received CODE_START"); controller = new RoombaController(); controller.Start(); DoUzdevums2(); } break; case WebServer.CODE_STOP: Debug.Print("Received CODE_STOP"); if (status != WebServer.STATUS_STOPPED) { Stop(); } break; } }
static void Main(string[] args) { RoombaController roomba = new RoombaController("127.0.0.1", 5000); }