private void Update(JcRobotNetworking.Command c) { Console.WriteLine("New Command: " + c.commandID + ", " + BitConverter.ToSingle(c.param, 0)); if (c.commandID == _motorTime) { _time = BitConverter.ToInt32(c.param, 0); } else { SetValue(c.commandID, BitConverter.ToSingle(c.param, 0)); } }
public void OnCommandRecieve(JcRobotNetworking.Command c) { switch (c.commandID) { case 1: speed = BitConverter.ToSingle(c.param, 0); break; case 2: turn = BitConverter.ToSingle(c.param, 0); break; } }
private void OnMessageReceive(JcRobotNetworking.Command c) { sw.Restart(); switch (c.commandID) { case 1: set_servo(BitConverter.ToSingle(c.param, 0)); break; case 2: set_drive(BitConverter.ToSingle(c.param, 0)); break; } }