aboutsummaryrefslogtreecommitdiff
path: root/doc/Lesson 1 Make The Car Move/left_wheel_rotation
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-08-26 20:33:02 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-08-26 20:33:02 +0200
commitba216919262d7f888bfb99debf81babe1ce88e0e (patch)
tree16c19610a7a3a77c97b99a63f6ba85d11ebde4ec /doc/Lesson 1 Make The Car Move/left_wheel_rotation
parentd80736ab6e8e3cad2f1a30c6eaba2d6883dbe967 (diff)
Move lessons to doc
Diffstat (limited to 'doc/Lesson 1 Make The Car Move/left_wheel_rotation')
-rwxr-xr-xdoc/Lesson 1 Make The Car Move/left_wheel_rotation/left_wheel_rotation.ino31
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/Lesson 1 Make The Car Move/left_wheel_rotation/left_wheel_rotation.ino b/doc/Lesson 1 Make The Car Move/left_wheel_rotation/left_wheel_rotation.ino
new file mode 100755
index 0000000..3a751c6
--- /dev/null
+++ b/doc/Lesson 1 Make The Car Move/left_wheel_rotation/left_wheel_rotation.ino
@@ -0,0 +1,31 @@
+//www.elegoo.com
+//2016.09.12
+
+/*In3 connected to the 7 pin,
+ In4 connected to the 6 pin, ENB pin 5,*/
+int ENB=5;
+int IN3=7;
+int IN4=6;
+void setup()
+{
+ pinMode(IN3,OUTPUT);
+ pinMode(IN4,OUTPUT);
+ pinMode(ENB,OUTPUT);
+ digitalWrite(ENB,HIGH);
+}
+void loop()
+{
+ digitalWrite(IN3,LOW);
+ digitalWrite(IN4,HIGH); //Left wheel forward
+ delay(500);
+ digitalWrite(IN3,LOW);
+ digitalWrite(IN4,LOW); //Left wheel stop
+ delay(500);
+ digitalWrite(IN3,HIGH);
+ digitalWrite(IN4,LOW); //Left wheel back
+ delay(500);
+ digitalWrite(IN3,LOW);
+ digitalWrite(IN4,LOW); //Left wheel stop
+ delay(500);
+}
+