主控板 |
Basra主控板(兼容Arduino Uno)
|
扩展板 |
Bigfish2.1扩展板
|
电池 | 7.4V锂电池 |
下面提供一个实现棘轮小车运动行走的参考程序(sketch_sep15b.ino):
/*------------------------------------------------------------------------------------ 版权说明:Copyright 2023 Robottime(Beijing) Technology Co., Ltd. All Rights Reserved. Distributed under MIT license.See file LICENSE for detail or copy at https://opensource.org/licenses/MIT by 机器谱 2023-09-20 https://www.robotway.com/ ------------------------------*/ #include<Servo.h> //调用舵机库 #define Servo_Pin 3 //定义舵机引脚号 #define Claw_Open_Angle 165 #define Claw_Close_Angle 30 Servo myservo; //声明舵机对象 //程序初始化部分:使能舵机引脚 void setup() { myservo.attach(Servo_Pin); //设置舵机引脚 } void loop() { myservo.write(Claw_Open_Angle); delay(1000); //等待1秒 myservo.write(Claw_Close_Angle); delay(1000); //等待1秒 }