5 Star 35 Fork 5

robodyno/机器谱开源机器人

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
Backward.ino 1.77 KB
Copy Edit Raw Blame History
song authored 2022-06-01 16:50 . add 207,022,052,203,210,212
/*------------------------------------------------------------------------------------
版权说明: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-31 https://www.robotway.com/
--------------------------
实验功能:
实现自适应四轮底盘后退.
----------------------------------------------------
实验接线:
一拖二直流电机线:左侧车轮接:D9,D10
| | | |
.-----------------------------------.
| |
| |-------.
| |【车头】|
| |-------*
| |
*-----------------------------------*
| | | |
一拖二直流电机线:右侧车轮接:D5,D6
------------------------------------------------------------------------------------*/
void Backward();// 后退
//程序初始化部分:设置电机引脚为输出模式
void setup() {
pinMode( 5 , OUTPUT); //将引脚5设置为输出模式
pinMode( 6 , OUTPUT); //将引脚6设置为输出模式
pinMode( 9 , OUTPUT); //将引脚9设置为输出模式
pinMode( 10 , OUTPUT);//将引脚10设置为输出模式
}
//主程序部分:小车后退
void loop(){
Backward();
}
//封装小车后退动作子程序
void Backward() {
digitalWrite( 5 , HIGH ); //右轮后退
digitalWrite( 6 , LOW );
digitalWrite( 9 , HIGH ); //左轮后退
digitalWrite( 10 , LOW);
}
马建仓 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