Exemple #1
0
 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));
     }
 }
Exemple #2
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;
            }
        }
Exemple #3
0
        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;
            }
        }