Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 2:bbd10b5da0bf
- Parent:
- 1:5a97a5e4ee44
- Child:
- 3:bc6c111b88da
--- a/main.cpp Mon Oct 22 07:07:35 2018 +0000
+++ b/main.cpp Mon Oct 22 08:35:25 2018 +0000
@@ -23,18 +23,18 @@
void turn_right(){
Mlefti = 2;
- Mleftp = 0.7f;
+ Mleftp = 0.5f;
Mrighti = 1;
- Mrightp = 0.2f;
+ Mrightp = 0.5f;
ledR = 1;
ledL = 0;
}
void turn_left(){
Mrighti = 2;
- Mrightp = 0.7f;
+ Mrightp = 0.5f;
Mlefti = 1;
- Mleftp = 0.2f;
+ Mleftp = 0.3f;
ledR = 0;
ledL = 1;
}
@@ -59,7 +59,7 @@
int main() {
go_straight();
- wait(0.5);
+ wait(0.2);
while(1) {
sensor[0] = sensorL.read();
sensor[1] = sensorCL.read();
@@ -70,7 +70,7 @@
turn_right();
else if( sensor[1] <= gray && sensor[2] >= white)
turn_left();
- else if( sensor[1] <= black && sensor[2] <= black)
+ else
go_straight();
if( sensor[0] <= gray && sensor[3] <= grayR){
stop_point();