Created
July 6, 2012 21:26
-
-
Save OEP/3062835 to your computer and use it in GitHub Desktop.
Drive Primitive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void write(byte bytes[]) { | |
| int opcode = bytes[0]; | |
| opcode = (opcode < 0) ? opcode + 256 : opcode; | |
| int velocity = (bytes[1] << 8) | (bytes[2] & 0xFF); | |
| int radius = (bytes[3] << 8) | (bytes[4] & 0xFF); | |
| System.out.println("write(" + opcode + ", " + velocity + ", " + radius + ")"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment