GettingStarted.ino
/*
* Table of Content
Function 1 - 4 : move to a certain point (f)
Fucntion d : detach servos
Function o : pump on
Function f : pump off
Function g : read current coordinate
Function 5 : Read Servo offset
*/
#include "uarm_library.h"
Wire.begin(); // join i2c bus (address optional for master)
Serial.begin(9600); // start serial port at 9600 bps
}
if(Serial.available()>0)
{
char readSerial = Serial.read();
Serial.println(readSerial);
//---------------------------------- function 1 ------------------------------------
// function below is for move uArm from current position to absolute coordinate
// x = 13, y = -13, z = 3
if (readSerial == '1') {
delay(1000);
}
//---------------------------------- function 2 ------------------------------------
// function below is for move uArm from current position to absolute coordinate
// x = -13, y = -13, z = 3
if (readSerial == '2') {
delay(1000);
}
//---------------------------------- function 3 ------------------------------------
// function below is for move uArm from current position to relatvie coordinate
// (dot) dx = 4, dy = -3, dz = 2 in 5 seconds
if (readSerial == '3') {
delay(1000);
}
//---------------------------------- function 4 ------------------------------------
// function below is for move uArm from current position to relatvie coordinate
// (dot) dx = -4, dy = 3, dz = -2 in 5 seconds
if (readSerial == '4') {
delay(1000);
}
//---------------------------------- function d ------------------------------------
// Detach Servo
if (readSerial == 'd') {
}
//---------------------------------- function a ------------------------------------
// Detach Servo
if (readSerial == 'a') {
}
//---------------------------------- function o ------------------------------------
// Pump on
if (readSerial == 'o') {
}
//---------------------------------- function f ------------------------------------
// Pump off
if (readSerial == 'f') {
}
//---------------------------------- function g ------------------------------------
// function below is for print current x,y,z absolute location
if (readSerial == 'g') {
Serial.print("The current location is ");
Serial.print(" , ");
Serial.print(" , ");
Serial.println();
delay(1000);
}
//---------------------------------- function 5 ------------------------------------
// function below is for read servo offset
if (readSerial == '5') {
Serial.print("SERVO_ROT_NUM offset:");
Serial.print("SERVO_LEFT_NUM offset:");
Serial.print("SERVO_RIGHT_NUM offset:");
Serial.print("SERVO_HAND_ROT_NUM offset:");
}
} // close read available
}