public frmMain() { InitializeComponent(); this.WindowState = FormWindowState.Maximized; //Load serial server: serSock = new serialServer(); serSock.setLogFunction(log); serSock.setMessageHandler(messageHandlerSocket); roomba = new clsRoomba(log, send); this.initDrawers(); //roomba.uncontrolledTest(2000, 2000); // DEFAULT, since Koen can't divide by 0. Sucker... ;) ============= \\ roomba.setSensorValue(24, 15); roomba.setSensorValue(25, 65535); roomba.setSensorValue(26, 65535); // ============= \\ }
static void setSensor(int sensorNr, byte[] values) { //log(String.Format("{0}",values[0]), logTags.roomba); switch (sensorNr) { case 7: case 9: case 10: case 11: case 12: case 21: roomba.setSensorValue(sensorNr, (int)values[0]); break; case 1337: roomba.uncontrolledTest(-1050, -1000); break; default: break; } }