Skip to content

Instantly share code, notes, and snippets.

@ril3y
Created February 14, 2012 22:06
Show Gist options
  • Save ril3y/1830910 to your computer and use it in GitHub Desktop.
Save ril3y/1830910 to your computer and use it in GitHub Desktop.
Parsing JSON Status Responses
if (line.contains("sr\":")) {
//Parse Status Report
this.X_AXIS.setWork_position(Float.parseFloat((json.getNode("sr").getNode("xwp").getText())));
this.Y_AXIS.setWork_position(Float.parseFloat((json.getNode("sr").getNode("ywp").getText())));
this.Z_AXIS.setWork_position(Float.parseFloat((json.getNode("sr").getNode("zwp").getText())));
this.A_AXIS.setWork_position(Float.parseFloat((json.getNode("sr").getNode("awp").getText())));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment