View: 515|Reply: 9

Adeept Robotic Arm for Arduino Program instructions

[Copy link]

6

Threads

47

Posts

651

Credits

Senior member

Rank: 4

Credits
651
Post time 2020-3-6 11:49:16 | Show all posts |Read mode
The function of a command like  “servo1.attach(pin);”  is  “Set the pin number of the controller connected to the servo”.
The function of a command like  “servo1.write(degrees );”  is  “Control how many degrees the servo rotates”.
The function of a command like  “val1 = map(analogRead(0), 0, 1023, 0, 180); ”  is  “Map the potentiometer value from 0 to 1023 into 0 to 255.”.
The function of a command like
if(dataServo1>val1){dataServo1--;  }  if(dataServo1<val1){dataServo1++;  }
  if(dataServo1>180) {dataServo1=180;}
  if(dataServo1<0)   {dataServo1=0;  }” is  “Set the steering gear to rotate in units of one degree. Prevent the servo from swinging too fast to damage the servo. At the same time, set the maximum and minimum values of the rotation range of the servo”.
The function of a command like
   if ( u8g.getMode() == U8G_MODE_R3G3B2 )
    u8g.setColorIndex(255);     // white
  else if ( u8g.getMode() == U8G_MODE_GRAY2BIT )
    u8g.setColorIndex(3);         // max intensity
  else if ( u8g.getMode() == U8G_MODE_BW )
    u8g.setColorIndex(1);         // pixel on
  u8g.setFont(u8g_font_6x10);
  u8g.setFontRefHeightExtendedText();
  u8g.setDefaultForegroundColor();
  u8g.setFontPosTop();” is  “Set the initialization procedure of the OLED display”.

The function of a command like
  EEPROM.write(addr, val1);
value1 = EEPROM.read(address);
” is  “Controls reading and writing of EEPROM data in the controller”.

The function of a command like
  itoa(number,string,10);
” is  “Convert numbers to strings”.

The function of a command like
   u8g.firstPage();  
  do {
    u8g.drawStr(0,0,"Current state:  ");
    if(number==0){
      u8g.drawStr(0,10,"    Working status  ");
      u8g.drawStr(0,28,"(1) (2)  (3)  (4) (5)");
      u8g.drawStr(0,41,string1);
      u8g.drawStr(27,41,string2);
      u8g.drawStr(54,41,string3);
      u8g.drawStr(81,41,string4);
      u8g.drawStr(109,41,string5);
    }else{
      u8g.drawStr(0,10,"   Learning Status  ");
      u8g.drawStr(0,30,"remaining steps:     ");
      u8g.drawStr(110,30,string);
    }
    u8g.drawStr(25,54,"www.adeept.com ");  
  } while( u8g.nextPage() );” is  “Display the data to be displayed on the OLED display”.

The function of a command like
   moveServoData = Serial.read();
    if (moveServoData == 111) {//o
” is  “Receive the data from the serial port, and determine whether the data is the key value "O" of the computer keyboard we need”.



If you don't understand anything, please leave a message below and I will reply as soon as possible

TOM



Reply

Use magic Report

0

Threads

4

Posts

16

Credits

Newbie

Rank: 1

Credits
16
Post time 2020-3-6 21:26:20 | Show all posts
All of this information is easliy understandable by looking at the code. HOW DO YOU CHANGE THE SPEED OF THE SERVOS.
Reply

Use magic Report

0

Threads

4

Posts

16

Credits

Newbie

Rank: 1

Credits
16
Post time 2020-3-7 00:27:16 | Show all posts
Your OLED example shows the AdeeptLearningArm program, which shows variable information.
How do you have the screen say "Hello" while running always? Please post that code.
Reply

Use magic Report

6

Threads

47

Posts

651

Credits

Senior member

Rank: 4

Credits
651
 Author| Post time 2020-3-7 10:33:17 | Show all posts
1583500762 replied at 2020-3-6 09:26 PM
All of this information is easliy understandable by looking at the code. HOW DO YOU CHANGE THE SPEED ...

Increase the value "delay (50);" to make the servo slow.

1

1
Reply

Use magic Report

6

Threads

47

Posts

651

Credits

Senior member

Rank: 4

Credits
651
 Author| Post time 2020-3-7 10:38:27 | Show all posts
1583500762 replied at 2020-3-7 12:27 AM
Your OLED example shows the AdeeptLearningArm program, which shows variable information.
How do you  ...

Just modify the code here to "Hello".

123

123
Reply

Use magic Report

0

Threads

4

Posts

16

Credits

Newbie

Rank: 1

Credits
16
Post time 2020-3-7 11:00:02 | Show all posts
1501915115 replied at 2020-3-7 10:33 AM
Increase the value "delay (50);" to make the servo slow.

It compiles but doesn't work.

In the void loop I have:

servo3.write(70);
delay(1000);
servo3.write(130);


How do I write code which slows it going from 70 to 130?


Reply

Use magic Report

6

Threads

47

Posts

651

Credits

Senior member

Rank: 4

Credits
651
 Author| Post time 2020-3-7 11:20:00 | Show all posts
1583500762 replied at 2020-3-7 11:00 AM
It compiles but doesn't work.

In the void loop I have:

Refer to this code

  1. /***********************************************************
  2. File name: AdeeptArmRobot.ino
  3. Description:
  4. Website: www.adeept.com
  5. E-mail: support@adeept.com
  6. Author: Tom
  7. Date: 2020/03/07
  8. ***********************************************************/
  9. #include <Servo.h>
  10. int servopin1 = 9;    //Define servo interface digital interface 9
  11. int servopin2 = 6;    //Define servo interface digital interface 6
  12. int servopin3 = 5;    //Define servo interface digital interface 5
  13. int servopin4 = 3;    //Define servo interface digital interface 3
  14. int servopin5 = 11;   //Define servo interface digital interface 11

  15. int dataServo1=90;
  16. int dataServo2=90;
  17. int dataServo3=90;
  18. int dataServo4=90;
  19. int dataServo5=90;
  20. Servo servo1;
  21. Servo servo2;
  22. Servo servo3;
  23. Servo servo4;
  24. Servo servo5;
  25. int angle = 90;        //Angle of rotation of the servo
  26. int val1;
  27. int val2;
  28. int val3;
  29. int val4;
  30. int val5;
  31. boolean autoLock = false;
  32. //boolean key_mouse_lock = false;
  33. boolean closeLock = false;

  34. void setup() {
  35.   // put your setup code here, to run once:
  36.   pinMode(servopin1,OUTPUT);//Set the servo interface as the output interface
  37.   pinMode(servopin2,OUTPUT);//Set the servo interface as the output interface
  38.   pinMode(servopin3,OUTPUT);//Set the servo interface as the output interface
  39.   pinMode(servopin4,OUTPUT);//Set the servo interface as the output interface
  40.   pinMode(servopin5,OUTPUT);//Set the servo interface as the output interface
  41.   Serial.begin(9600);
  42.   servo1.attach(servopin1);
  43.   servo2.attach(servopin2);
  44.   servo3.attach(servopin3);
  45.   servo4.attach(servopin4);
  46.   servo5.attach(servopin5);
  47.   //servo(1~5).write(90);has 90 equal to 0 point

  48.   delay(5000);
  49.   servo1.write(90);//original base rotation
  50.   servo2.write(90);//original shoulder angle
  51.   servo3.write(90);//initial elblow angle
  52.   servo4.write(90);//initial wrist angle
  53.   servo5.write(90); //initial finger clamp
  54.   delay(200);
  55.   //servo1Pulse(90);
  56. }
  57. void loop() {

  58. //    servo3.write(70);//dipping to battery side
  59. //    servo2.write(0);
  60. //    delay(5000);
  61. //    servo2.write(80);
  62. //    delay(200);
  63. //    servo3.write(130);
  64. //    delay(5000);

  65.     val1 = 90;//Control the value(90 degrees) of servo 1  
  66.     val2 = 0;//Control the value(0 degree) of servo 2
  67.     val3 = 70;//Control the value(70 degrees) of servo 3  
  68.     val4 = 90;//Control the value(90 degrees) of servo 4
  69.     val5 = 90;//Control the value(90 degrees) of servo 5
  70.     for(int i=0;i<180;i++){ServoAngle();}
  71.    
  72.     val1 = 90;//Control the value(90 degrees) of servo 1  
  73.     val2 = 80;//Control the value(0 degree) of servo 2
  74.     val3 = 130;//Control the value(70 degrees) of servo 3  
  75.     val4 = 90;//Control the value(90 degrees) of servo 4
  76.     val5 = 90;//Control the value(90 degrees) of servo 5
  77.     for(int i=0;i<180;i++){ServoAngle();}
  78.    
  79. }
  80. void ServoAngle(void)
  81. {
  82.   servo1.write(dataServo1);//goes to dataServo1 degrees
  83.   servo2.write(dataServo2);//goes to dataServo2 degrees
  84.   servo3.write(dataServo3);//goes to dataServo3 degrees
  85.   servo4.write(dataServo4);//goes to dataServo4 degrees
  86.   servo5.write(dataServo5);//goes to dataServo5 degrees  

  87.   if(dataServo1>val1){dataServo1--;  }
  88.   if(dataServo1<val1){dataServo1++;  }
  89.   if(dataServo1>180) {dataServo1=180;}
  90.   if(dataServo1<0)   {dataServo1=0;  }

  91.   if(dataServo2>val2){dataServo2--;  }
  92.   if(dataServo2<val2){dataServo2++;  }
  93.   if(dataServo2>180) {dataServo2=180;}
  94.   if(dataServo2<0)   {dataServo2=0;  }

  95.   if(dataServo3>val3){dataServo3--;  }
  96.   if(dataServo3<val3){dataServo3++;  }
  97.   if(dataServo3>180) {dataServo3=180;}
  98.   if(dataServo3<0)   {dataServo3=0;  }

  99.   if(dataServo4>val4){dataServo4--;  }
  100.   if(dataServo4<val4){dataServo4++;  }
  101.   if(dataServo4>180) {dataServo4=180;}
  102.   if(dataServo4<0)   {dataServo4=0;  }
  103.   
  104.   if(dataServo5>val5){dataServo5--;  }
  105.   if(dataServo5<val5){dataServo5++;  }
  106.   if(dataServo5>90) {dataServo5=90;}
  107.   if(dataServo5<35)  {dataServo5=35; }
  108.   delay(50);//wait for 0.05second
  109. }
Copy the Code



Reply

Use magic Report

0

Threads

4

Posts

16

Credits

Newbie

Rank: 1

Credits
16
Post time 2020-3-9 22:09:02 | Show all posts
Thank you!
Reply

Use magic Report

0

Threads

1

Posts

6

Credits

Newbie

Rank: 1

Credits
6
Post time 2020-5-10 06:51:11 | Show all posts
Buenas tardes compre un robot Arduino robotic Arm y por accidente borre el Código del Arduino que viene programado. en donde lo podria encontrar o si me lo pueden pasar.
Reply

Use magic Report

1

Threads

49

Posts

150

Credits

Registered member

Rank: 2

Credits
150
Post time 2020-7-20 11:24:48 | Show all posts
1589063758 replied at 2020-5-10 06:51 AM
Buenas tardes compre un robot Arduino robotic Arm y por accidente borre el Código del Arduino que v ...

Thanks for the support!
Reply

Use magic Report

You have to log in before you can reply Login | Sign Up

Points Rules