This sketch is a communication protocol for uArm using Serial.
All commands must be wrapped in brackets- [command] Any string of commands must end with an endline char '
' for the commands to be processed
Commands: [moveX::Y::Z::S#] Where # is a double, This will move the robot to an XYZ position, in S is speed in centimeters / second from the current location to goal location Send Example: [moveX15Y-15Z20S25] Return Example: [OK moveX15Y-15Z20S2]
[handV#] Where # is an angle between 0 and 180. This will set the angle of the robots hand Send Example: [handV90] Return Example: [OK handV90]
[pumpV#] Where # is either 1 or 0. 1 means pump on, 0 means pump off. Send Example: [pumpV1] Return Example: [OK pumpV1]
[attachS#] Attach servo #. Same as servo #'s in uarm_library.h Send Example: [attachS1] Return Example: [OK attachS1]
[detachS#] Detach servo #. Same as servo #'s in uarm_library.h Send Example: [detachS1] Return Example: [OK detachS1]
[buzzF::T#] Set the buzzer to F Frequency for T time Send Example: [buzzF261.63T1] Return Example: [OK buzzF261.63T1]
[gcoords] Returns the XYZ position of the robot Send Example: [gcoords] Return Example: [coordsX::Y::Z#]
[gAngleS#] Returns the angle of any particular servo. Send Example: [angleA1] Return Example: [angleA###.##]
[gmoving] Returns whether or not the robot is currently moving. Returns either 1 or 0 if it is moving or not. Send Example: [gmoving] Return Example: [movingM1]
[gtip] Returns whether or not the tip of the robot is currently pressed. Returns either 1 if the tip is pressed, 0 if not. Send Example: [gtip] Return Example: [tipV1]