python代码控制机械臂_机械臂控制代码

2022-03-31 09:12
33
0
添加收藏

#

#include

#include

#include

#include "Wire.h"

#include "WiiChuck.h"

Servo servo1; // create servo object to control a servo

Servo servo2;

Servo servo3;

Servo servo4;

// a maximum of eight servo objects can be created

Servo servo5;

Servo servo6;

WiiChuck wii = WiiChuck();

int pos1,pos2,pos3,pos4,pos5,pos6,x,y,z,c;

// variable to store the servo position

void setup()

{undefined

// attaches the servo on pin 9 to the servo object

servo1.attach(8);

servo2.attach(9);

servo3.attach(10);

servo4.attach(11);

servo5.attach(12);

servo6.attach(13);

pos1 = 60;

pos2 = 50;

pos3 = 100;

pos4 =100;

pos5 = 90;

pos6 = 90;

servo1.write(pos1);

servo2.write(pos2);

servo3.write(pos3);

servo4.write(pos4);

servo5.write(pos5);

servo6.write(pos6);

wii.initWithPower();

}

void loop()

{undefined

全部评论