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 5 Line tracking car.avi | Bin 14721626 -> 0 bytes Lesson 5 Line Tracking Car/Line tracking car.pdf | Bin 496571 -> 0 bytes .../Line_tracking_car/Line_tracking_car.ino | 105 --------------------- Lesson 5 Line Tracking Car/~$ne-Tracking Car.docx | Bin 162 -> 0 bytes 4 files changed, 105 deletions(-) delete mode 100755 Lesson 5 Line Tracking Car/Lesson 5 Line tracking car.avi delete mode 100755 Lesson 5 Line Tracking Car/Line tracking car.pdf delete mode 100755 Lesson 5 Line Tracking Car/Line_tracking_car/Line_tracking_car.ino delete mode 100755 Lesson 5 Line Tracking Car/~$ne-Tracking Car.docx (limited to 'Lesson 5 Line Tracking Car') diff --git a/Lesson 5 Line Tracking Car/Lesson 5 Line tracking car.avi b/Lesson 5 Line Tracking Car/Lesson 5 Line tracking car.avi deleted file mode 100755 index 2b91472..0000000 Binary files a/Lesson 5 Line Tracking Car/Lesson 5 Line tracking car.avi and /dev/null differ diff --git a/Lesson 5 Line Tracking Car/Line tracking car.pdf b/Lesson 5 Line Tracking Car/Line tracking car.pdf deleted file mode 100755 index dad26e4..0000000 Binary files a/Lesson 5 Line Tracking Car/Line tracking car.pdf and /dev/null differ diff --git a/Lesson 5 Line Tracking Car/Line_tracking_car/Line_tracking_car.ino b/Lesson 5 Line Tracking Car/Line_tracking_car/Line_tracking_car.ino deleted file mode 100755 index d3dc773..0000000 --- a/Lesson 5 Line Tracking Car/Line_tracking_car/Line_tracking_car.ino +++ /dev/null @@ -1,105 +0,0 @@ -//www.elegoo.com -//2016.09.12 - -int in1=9; -int in2=8; -int in3=7; -int in4=6; -int ENA=10; -int ENB=5; - int ABS=130; - void _mForward() -{ - analogWrite(ENA,ABS); - analogWrite(ENB,ABS); - digitalWrite(in1,LOW); - digitalWrite(in2,HIGH); - digitalWrite(in3,LOW); - digitalWrite(in4,HIGH); - Serial.println("go forward!"); -} - -void _mBack() -{ - analogWrite(ENA,ABS); - analogWrite(ENB,ABS); - digitalWrite(in1,HIGH); - digitalWrite(in2,LOW); - digitalWrite(in3,HIGH); - digitalWrite(in4,LOW); - Serial.println("go back!"); -} - -void _mleft() -{ - analogWrite(ENA,ABS); - analogWrite(ENB,ABS); - digitalWrite(in1,LOW); - digitalWrite(in2,HIGH); - digitalWrite(in3,HIGH); - digitalWrite(in4,LOW); - Serial.println("go left!"); -} - -void _mright() -{ - analogWrite(ENA,ABS); - analogWrite(ENB,ABS); - digitalWrite(in1,HIGH); - digitalWrite(in2,LOW); - digitalWrite(in3,LOW); - digitalWrite(in4,HIGH); - Serial.println("go right!"); -} -void _mStop() -{ - digitalWrite(ENA,LOW); - digitalWrite(ENB,LOW); - Serial.println("Stop!"); -} - -void setup() -{ - Serial.begin(9600); -} - -void loop() { - int num1,num2,num3; - num1=digitalRead(11); - num2=digitalRead(4); - num3=digitalRead(2); - if((num1==0)&&num2&&num3) - { - _mleft(); //The sensor detected that right car turn left immediately when it meets black line - delay(2); - while(1){ - num2=digitalRead(2); //Cycle to judge degree of intermediate sensor, - if(num2==1) - { _mleft(); //If num2==1 does not go to the middle position, continue to turn left. - delay(2);} - else - break; //Detection of num2==0 instructions turned over, out of the loop, detection of three sensors’ statusand then make appropriate action - } //The following and so on - } - - else if(num2&&num1&&(num3==0)) - { - _mright(); - delay(2); - while(1) - { - num2=digitalRead(2); - if(num2==1){ - _mright(); - delay(2);} - else - break; - } - } - else - { - _mForward(); - delay(2); - } -} - diff --git a/Lesson 5 Line Tracking Car/~$ne-Tracking Car.docx b/Lesson 5 Line Tracking Car/~$ne-Tracking Car.docx deleted file mode 100755 index f3b4136..0000000 Binary files a/Lesson 5 Line Tracking Car/~$ne-Tracking Car.docx and /dev/null differ -- cgit v1.2.3