UArmTextControl2.0.ino File Reference
#include <uarm_library.h>

Functions

void setup ()
 
void loop ()
 
String runCommand (String cmnd)
 
void getCommandValues (String cmnd, String parameters[], int parameterCount, float *valueArray)
 
String isValidCommand (String cmnd, String parameters[], int parameterCount)
 
String parseNextCommand ()
 
void setMove (double x, double y, double z, double goalSpeed)
 
bool isTimeToMove ()
 
void moveStep ()
 

Variables

byte currentStep = 255
 
int tipPin = 2
 
int buzzerPin = 3
 
unsigned int INTERP_INTVLS
 
long goalTime
 
double goalTimeStep
 
double x_array [51]
 
double y_array [51]
 
double z_array [51]
 
double currentHand =90
 
long buzzerStopTime = -1
 
String message = ""
 

Function Documentation

void getCommandValues ( String  cmnd,
String  parameters[],
int  parameterCount,
float *  valueArray 
)
bool isTimeToMove ( )
String isValidCommand ( String  cmnd,
String  parameters[],
int  parameterCount 
)
void loop ( )
void moveStep ( )
String parseNextCommand ( )
String runCommand ( String  cmnd)
void setMove ( double  x,
double  y,
double  z,
double  goalSpeed 
)
void setup ( )

Variable Documentation

int buzzerPin = 3
long buzzerStopTime = -1
double currentHand =90
byte currentStep = 255

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]

long goalTime
double goalTimeStep
unsigned int INTERP_INTVLS
String message = ""
int tipPin = 2
double x_array[51]
double y_array[51]
double z_array[51]