5 Star 33 Fork 3

robodyno / 机器谱开源机器人

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
MotorDrive.ino 1.23 KB
Copy Edit Raw Blame History
song authored 2022-05-27 10:46 . add M003
/*------------------------------------------------------------------------------------
版权说明: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-27 https://www.robotway.com/
----------------------------
实验功能:
实现直流电机模组正转反转.
-----------------------------
实验接线:
直流电机引脚接D5,D6引脚.
------------------------------------------------------------------------------------*/
//程序初始化部分:初始化直流电机引脚.
void setup() {
pinMode( 5 , OUTPUT);//将引脚5设置为输出模式
pinMode( 6 , OUTPUT);//将引脚6设置为输出模式
}
//主程序部分:实现直流电机持续执行正转一秒,反转1秒动作组.
void loop() {
digitalWrite( 5 , LOW ); //-------------.
digitalWrite( 6 , HIGH ); //电机模组正转1秒|
delay( 1000); //-------------*
digitalWrite( 5 , HIGH ); //-------------.
digitalWrite( 6 , LOW); //电机模组反转1秒|
delay( 1000); //-------------*
}
马建仓 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

344bd9b3 5694891 D2dac590 5694891