From ba216919262d7f888bfb99debf81babe1ce88e0e Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 26 Aug 2017 20:33:02 +0200 Subject: Move lessons to doc --- Lesson 1 Make The Car Move/AUTO_GO_/AUTO_GO_.ino | 77 ------------------------ 1 file changed, 77 deletions(-) delete mode 100755 Lesson 1 Make The Car Move/AUTO_GO_/AUTO_GO_.ino (limited to 'Lesson 1 Make The Car Move/AUTO_GO_') diff --git a/Lesson 1 Make The Car Move/AUTO_GO_/AUTO_GO_.ino b/Lesson 1 Make The Car Move/AUTO_GO_/AUTO_GO_.ino deleted file mode 100755 index bcf48f2..0000000 --- a/Lesson 1 Make The Car Move/AUTO_GO_/AUTO_GO_.ino +++ /dev/null @@ -1,77 +0,0 @@ -//www.elegoo.com -//2016.09.12 - -/*define logic control output pin*/ -int in1=9; -int in2=8; -int in3=7; -int in4=6; -/*define channel enable output pins*/ -int ENA=10; -int ENB=5; -/*define forward function*/ -void _mForward() -{ - digitalWrite(ENA,HIGH); - digitalWrite(ENB,HIGH); - digitalWrite(in1,LOW);//digital output - digitalWrite(in2,HIGH); - digitalWrite(in3,LOW); - digitalWrite(in4,HIGH); - Serial.println("Forward"); -} -/*define back function*/ -void _mBack() -{ - digitalWrite(ENA,HIGH); - digitalWrite(ENB,HIGH); - digitalWrite(in1,HIGH); - digitalWrite(in2,LOW); - digitalWrite(in3,HIGH); - digitalWrite(in4,LOW); - Serial.println("Back"); -} -/*define left function*/ -void _mleft() -{ - digitalWrite(ENA,HIGH); - digitalWrite(ENB,HIGH); - digitalWrite(in1,LOW); - digitalWrite(in2,HIGH); - digitalWrite(in3,HIGH); - digitalWrite(in4,LOW); - Serial.println("Left"); -} -/*define right function*/ -void _mright() -{ - digitalWrite(ENA,HIGH); - digitalWrite(ENB,HIGH); - digitalWrite(in1,HIGH); - digitalWrite(in2,LOW); - digitalWrite(in3,LOW); - digitalWrite(in4,HIGH); - Serial.println("Right"); -} -/*put your setup code here, to run once*/ -void setup() { - Serial.begin(9600); //Open the serial port and set the baud rate to 9600 -/*Set the defined pins to the output*/ - pinMode(in1,OUTPUT); - pinMode(in2,OUTPUT); - pinMode(in3,OUTPUT); - pinMode(in4,OUTPUT); - pinMode(ENA,OUTPUT); - pinMode(ENB,OUTPUT); -} -/*put your main code here, to run repeatedly*/ -void loop() { -_mForward(); -delay(1000); -_mBack(); -delay(1000); -_mleft(); -delay(1000); -_mright(); -delay(1000); -} -- cgit v1.2.3