
public class SerialCommands {
	public static void sendDeltas(SerialCom serialCom, int deltaLeft, int deltaRight) {
		byte dataL1 = (byte) ((deltaLeft & 0xFF00) >> 8);
		byte dataL2 = (byte) (deltaLeft & 0xFF);
		byte dataR1 = (byte) ((deltaRight & 0xFF00) >> 8);
		byte dataR2 = (byte) (deltaRight & 0xFF);
		byte[] data = new byte[] {dataL1, dataL2, dataR1, dataR2};
		serialCom.send(data);
		
		// wait for a response = move complete
		byte[] bytes = null;
		while(bytes == null
				|| bytes.length <= 0) {
			bytes = serialCom.recieve();
		}
	}
}
