7 Star 47 Fork 6

robodyno/机器谱开源机器人

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
BigTurn.ino 1.93 KB
Copy Edit Raw Blame History
song authored 2022-05-31 14:52 +08:00 . update 255, add M005, add M006
/*------------------------------------------------------------------------------------
版权说明:Copyright 2022 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 机器谱 2022-5-26 https://www.robotway.com/
------------------------------------------------------
实验功能:
实现月球实现小车大半径转向(原理为小车车轮同向不同速)
------------------------------------------------------
实验接线:
一拖三直流电机线:左侧车轮接:D9,D10
| | | | | |
.-----------------------------------.
| |
| |-------.
| |【车头】|
| |-------*
| |
*-----------------------------------*
| | | | | |
一拖三直流电机线:右侧车轮接:D5,D6
------------------------------------------------------------------------------------*/
void big_Turn();// 大半径转向
//程序初始化部分:设置电机引脚为输出模式
void setup() {
pinMode( 5 , OUTPUT); //将引脚5设置为输出模式
pinMode( 6 , OUTPUT); //将引脚6设置为输出模式
pinMode( 9 , OUTPUT); //将引脚9设置为输出模式
pinMode( 10 , OUTPUT);//将引脚10设置为输出模式
}
//主程序部分:小车走弧形路径
void loop() {
big_Turn();
delay( 100 );
}
//封装小车走大半径(弧线)动作子程序(同向不同速)
void big_Turn() {
analogWrite( 5 , 0 ); //右轮以255速度前进
analogWrite( 6 , 255);
analogWrite( 9 , 0 ); //左轮以150速度前进
analogWrite( 10 , 150 );
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/robodyno/Robotway-Open-Robots.git
git@gitee.com:robodyno/Robotway-Open-Robots.git
robodyno
Robotway-Open-Robots
机器谱开源机器人
master

Search