Arduino controlled Uarm

Hi I have just build a uArm design from uFactory. I don't have a uArm shield can I wire it to arduino without shield. Where would I get program sketch to control it using mouse.
Liam

uFactory doesn't have any programs to run?

I am very new to arduino. I guess there is program for it on uFactory but I don't know what to download. Also do I need a uArm shield

The uArms I've seen use servos which can be controlled with an arduino with a separate power supply for the servos.

My problem is that I havn't got a uArm shield and I don't have the sketch to use so as to control the uArm using the mouse. If I had the sketch could wire the servos into the PWM outputs they need to go to. I would really like is someone could help me

Servo test code you can try to see if your servos work. If your mouse control is from a pc, then you will need to wright or obtain the pc programming for that type control.

//zoomkat 11-22-12 simple delimited ',' string parse 
//from serial port input (via serial monitor)
//and print result out serial port
//multi servos added 
// Powering a servo from the arduino usually *DOES NOT WORK*.

String readString;
#include <Servo.h> 
Servo myservoa, myservob, myservoc, myservod;  // create servo object to control a servo 

void setup() {
  Serial.begin(9600);

  //myservoa.writeMicroseconds(1500); //set initial servo position if desired

  myservoa.attach(6);  //the pin for the servoa control
  myservob.attach(7);  //the pin for the servob control
  myservoc.attach(8);  //the pin for the servoc control
  myservod.attach(9);  //the pin for the servod control 
  Serial.println("multi-servo-delimit-test-dual-input-11-22-12"); // so I can keep track of what is loaded
}

void loop() {

  //expect single strings like 700a, or 1500c, or 2000d,
  //or like 30c, or 90a, or 180d,
  //or combined like 30c,180b,70a,120d,

  if (Serial.available())  {
    char c = Serial.read();  //gets one byte from serial buffer
    if (c == ',') {
      if (readString.length() >1) {
        Serial.println(readString); //prints string to serial port out

        int n = readString.toInt();  //convert readString into a number

        // auto select appropriate value, copied from someone elses code.
        if(n >= 500)
        {
          Serial.print("writing Microseconds: ");
          Serial.println(n);
          if(readString.indexOf('a') >0) myservoa.writeMicroseconds(n);
          if(readString.indexOf('b') >0) myservob.writeMicroseconds(n);
          if(readString.indexOf('c') >0) myservoc.writeMicroseconds(n);
          if(readString.indexOf('d') >0) myservod.writeMicroseconds(n);
        }
        else
        {   
          Serial.print("writing Angle: ");
          Serial.println(n);
          if(readString.indexOf('a') >0) myservoa.write(n);
          if(readString.indexOf('b') >0) myservob.write(n);
          if(readString.indexOf('c') >0) myservoc.write(n);
          if(readString.indexOf('d') >0) myservod.write(n);
        }
         readString=""; //clears variable for new input
      }
    }  
    else {     
      readString += c; //makes the string readString
    }
  }
}

What, EXACTLY, do you expect the arm to do when you move the mouse to the left? To the right? Up? Down? On a diagonal?

Until you can answer these questions, you can NOT control the arm using a mouse.

The 3 servos move 180°. The servo to turn the arm (yaw) turns 180°. The 2 servos controlling the “wrist” and the “elbow” turn about 90°each

Jimmywilkin:
The 3 servos move 180°. The servo to turn the arm (yaw) turns 180°. The 2 servos controlling the “wrist” and the “elbow” turn about 90°each

Most hobby servos can do that being controlled by an arduino. Have you developed your mouse control? If not, then that is what you probably need to work on first.

Is there a sketch for mouse control

Is there a sketch for mouse control

No. You have not explained how you think a 2D mouse is going to control a 3D arm.

There is a sketch to control uArm using mouse through computer as in youtube videos below.
My problem is I know very little about writing sketches for arduino so what I need is a sketch I can copy and upload to my arduino. I don't have a uArm shield but I assume I can connect the signal wire of my servos to PWM outputs on my arduino. I think the sketch can be downloaded from uArm.cc but I don't know how to get it. If someone has the sketch I need I would really appreciate if I could get it.

Hi I have the sketch in www.UFactory.cc
laden . hir he is I hope I could help you more = ^ . ^ =

/************************************************************************

  • File Name : Standard
  • Author : Evan
  • Updated : Evan
  • Version : V0.0.1
  • Date : 15 June, 2014
  • Description : Mouse Control or Leap Motion Control(Processing),
    Calibration Mode & Rrecording Mode.
  • License :
  • Copyright(C) 2014 UFactory Team. All right reserved.
    *************************************************************************/
    #include <EEPROM.h>
    #include <UF_uArm.h>

int heightTemp = 0, stretchTemp = 0, rotationTemp = 0, handRotTemp = 0;
char stateMachine = 0, counter = 0;
char dataBuf[9] = {0};
UF_uArm uarm; // initialize the uArm library

void setup()
{
Serial.begin(9600); // start serial port at 9600 bps
// while(!Serial); // wait for serial port to connect. Needed for Leonardo only
uarm.init(); // initialize the uArm position
uarm.setServoSpeed(SERVO_R, 0); // 0=full speed, 1-255 slower to faster
uarm.setServoSpeed(SERVO_L, 0); // 0=full speed, 1-255 slower to faster
uarm.setServoSpeed(SERVO_ROT, 50); // 0=full speed, 1-255 slower to faster
}

void loop()
{
uarm.calibration(); // if corrected, you could remove it, no harm though
uarm.recordingMode(50); // sampling time: 50ms, Recording time: 17 seconds.
if(Serial.available())
{
byte rxBuf = Serial.read();
if(stateMachine == 0)
{
stateMachine = rxBuf == 0xFF? 1:0;
}
else if(stateMachine == 1)
{
stateMachine = rxBuf == 0xAA? 2:0;
}
else if(stateMachine == 2)
{
dataBuf[counter++] = rxBuf;
if(counter > 8) // receive 9 byte data
{
stateMachine = 0;
counter=0;
*((char *)(&rotationTemp) ) = dataBuf[1]; // recevive 1byte
*((char *)(&rotationTemp)+1) = dataBuf[0];
*((char *)(&stretchTemp ) ) = dataBuf[3];
*((char *)(&stretchTemp )+1) = dataBuf[2];
*((char *)(&heightTemp ) ) = dataBuf[5];
*((char *)(&heightTemp )+1) = dataBuf[4];
*((char *)(&handRotTemp ) ) = dataBuf[7];
*((char )(&handRotTemp )+1) = dataBuf[6];
uarm.setPosition(stretchTemp, heightTemp, rotationTemp, handRotTemp);
/
pump action, Valve Stop. /
if(dataBuf[8] & CATCH) uarm.gripperCatch();
/
pump stop, Valve action.
Note: The air relief valve can not work for a long time,
should be less than ten minutes. /
if(dataBuf[8] & RELEASE) uarm.gripperRelease();
}
}
}
/
delay release valve, this function must be in the main loop */
uarm.gripperDetach();
}

This is great if I can get it to work. I don't what outputs of my arduino to connect the signal wires of my servos to. When I do I will then have to specify them in my sketch. It is all of this I am not clear on.

hey I have a leg Freud me shied ordered because it not get shut Amazon true ^^
But have me as a uarm ordered is no steuerrung

if it's because I look it to me , and make for you a few images :smiley:

I also have made a robotic arm . See how it's work : http://nmwrobotics.com

Thank you !