struct NxcMovementPacket { byte Motor; byte Pwr; int Degrees; bool Brake; }; task main() { int i = 0; while(true) { ResetSleepTimer(); string commandString; int resp = ReceiveRemoteString(0, true, commandString); if(resp == 64) { ClearScreen(); TextOut(0, LCD_LINE1, "INPUT NEED INPUT"); Wait(1); } else { SendResponseBool(0, false); TextOut(0, LCD_LINE1, "NO DISASSEMBLE!!"); NxcMovementPacket packet; UnflattenVar(commandString, packet); NumOut(0, LCD_LINE3, packet.Motor); NumOut(0, LCD_LINE4, packet.Pwr); NumOut(0, LCD_LINE5, packet.Degrees); NumOut(0, LCD_LINE6, packet.Brake); if(packet.Pwr == 0) { Off(packet.Motor); } else if(packet.Degrees == 0) { OnFwd(packet.Motor, packet.Pwr); } else { ResetTachoCount(packet.Motor); RotateMotorEx(packet.Motor, packet.Pwr, packet.Degrees, 0, false, packet.Brake); SendResponseBool(0, true); } } } }