Robot-mycobot
We would update one by one, now we can use the following two method to run it:
- Use hand to move machine and it would record the movement, it would play according to the movement;
- Use Arduino to run;
Arduino example
#include <CommunicateDefine.h>
#include <MycobotBasic.h>
#include <ParameterList.h>
#include <MycobotBasic.h>
#include <ParameterList.h>
MycobotBasic myCobot;
Angles angles = { -0.0, -0.0, -0.0, -0.0, -0.0, -0.0 };
void setup() {
myCobot.setup();
myCobot.powerOn();
for(auto &val : angles)
val = 0.0;
myCobot.WriteAngles(angles, 50);
delay(5000);
}
void loop() {
for(int i = 1; i < 7; i++) //run
{
myCobot.setLEDRGB(0XFF, 0, 0); // set RGB show red
delay(50);
//myCobot.WriteAngle(i,angle,0-100);
myCobot.WriteAngle(i, -90, 100); // set joint angle -90 degree
delay(4000);
myCobot.setLEDRGB(0, 0XFF, 0); // set RGB show blue
delay(50);
myCobot.WriteAngle(i, 90, 100); // set joint angle 90 degree
delay(4000);
myCobot.setLEDRGB(0, 0, 0XFF); // set RGB show green
delay(50);
myCobot.WriteAngle(i, 0, 100); // set joint angle 0 degree
delay(4000);
}
}
remember to add Arduino library in google drive link