DFRobot Insectbot Hexa 조립 설명서 - 페이지 4

{카테고리_이름} DFRobot Insectbot Hexa에 대한 조립 설명서을 온라인으로 검색하거나 PDF를 다운로드하세요. DFRobot Insectbot Hexa 10 페이지. An arduino based walking robot kit for kids

DFRobot Insectbot Hexa 조립 설명서
4. Attaching the legs to the servo
Before you attach the legs to the servos please make sure your servos are centered. To do this,
please connect all three servos to the digital pins D9, D10 and D11 (see more details below) of the
Beetle shield and upload the following program to the Beetle. The file name is
insect_bot_servo_center.ino and available on the product/Wiki website at DFRobot.com
#include <Servo.h>
// creating the servo objects for front, rear and mid servo
Servo frontLeg;
Servo rearLeg;
Servo midLeg;
// setting the servo angle to 90° for startup
byte frontAngle = 90;
byte rearAngle = 90;
byte midAngle = 90;
// Setup function
void setup(){
frontLeg.attach(9);
rearLeg.attach(10);
midLeg.attach(11);
// move servos to center position -> 90°
frontLeg.write(frontAngle);
rearLeg.write(rearAngle);
midLeg.write(midAngle);
delay(2000);
}
// The loop remains empty
void loop(){
}
Put the legs with the servo horn on the servo shaft and secure them with the provided screw.