Go Down

Topic: tinkerkit help (Read 92 times) previous topic - next topic

claudio_de_luca

hi I am making a project with the arm. I have a problem with the sketch, I would like to remove the arm.begin () function; which starts the arm in the following position (90,45,180,180,90,10). I want to start the arm in the position I choose. how can i change this function ?? I am attaching the sketc.


/*
  simpleMovements.ino

 This  sketch simpleMovements shows how they move each servo motor of Braccio

 Created on 18 Nov 2015
 by Andrea Martino

 This example is in the public domain.
 */

#include <Braccio.h>
#include <Servo.h>

Servo base;
Servo shoulder;
Servo elbow;
Servo wrist_rot;
Servo wrist_ver;
Servo gripper;

void setup() {
  //Initialization functions and set up the initial position for Braccio
  //All the servo motors will be positioned in the "safety" position:
  //Base (M1):90 degrees
  //Shoulder (M2): 45 degrees
  //Elbow (M3): 180 degrees
  //Wrist vertical (M4): 180 degrees
  //Wrist rotation (M5): 90 degrees
  //gripper (M6): 10 degrees
  Braccio.begin();
}

void loop() {
   /*
   Step Delay: a milliseconds delay between the movement of each servo.  Allowed values from 10 to 30 msec.
   M1=base degrees. Allowed values from 0 to 180 degrees
   M2=shoulder degrees. Allowed values from 15 to 165 degrees
   M3=elbow degrees. Allowed values from 0 to 180 degrees
   M4=wrist vertical degrees. Allowed values from 0 to 180 degrees
   M5=wrist rotation degrees. Allowed values from 0 to 180 degrees
   M6=gripper degrees. Allowed values from 10 to 73 degrees. 10: the toungue is open, 73: the gripper is closed.
  */
 
                       //(step delay, M1, M2, M3, M4, M5, M6);
  Braccio.ServoMovement(20,           0,  15, 180, 170, 0,  73); 

  //Wait 1 second
  delay(1000);

  Braccio.ServoMovement(20,           180,  165, 0, 0, 180,  10); 

  //Wait 1 second
  delay(1000);
}

pert

Please provide a detailed explanation of what you mean by "I want to start the arm in the position I choose".

claudio_de_luca

void setup() {
  //Initialization functions and set up the initial position for Braccio
  //All the servo motors will be positioned in the "safety" position:
  //Base (M1):90 degrees
  //Shoulder (M2): 45 degrees
  //Elbow (M3): 180 degrees
  //Wrist vertical (M4): 180 degrees
  //Wrist rotation (M5): 90 degrees
  //gripper (M6): 10 degrees
  Braccio.begin();
}
I want to change this part of sketch, to get another position when doing initiation.

the problem is that the initialization is not written in sketch with degrees, but is written with this function Braccio.begin();
I would like to delete this sentence and put the degrees for each servomotor so that I can also manage the part of the void setap.

I apologize if I can't make myself understood, but I'm an Italian who writes with the translator.


Go Up