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:
- 13:6a8689f601cd
- Parent:
- 12:dfc717775297
- Child:
- 14:408d9d087d0f
--- a/main.cpp Thu Nov 22 12:37:09 2018 +0000 +++ b/main.cpp Thu Nov 29 12:24:51 2018 +0000 @@ -4,7 +4,7 @@ m3pi m3pi; // Minimum and maximum motor speeds -#define MAX 0.5 +#define MAX 0.3 #define MIN 0 // PID terms @@ -28,7 +28,17 @@ m3pi.locate(0,0); m3pi.printf("%d", arr[4]); } - + +int maze (void) +{ + + return 1; +} +void turn_right (void) +{ + m3pi.right (0.3); + wait (0.2); +} int main() { @@ -86,13 +96,15 @@ //Marc's sensor test sensor_all(sensor_val); // sensor_value gets fkt value - if ((sensor_val[0] > 800) && (sensor_val[4] > 800)) + if (sensor_val[0] > 350 && sensor_val[4] > 350) { - speed = 0.2; - } - if ((sensor_val[0] > 800) && (sensor_val[4] > 150)) - { - speed = 0.8; + + m3pi.stop(); + turn_right(); + m3pi.stop(); + m3pi.forward(0.2); + wait (0.5); + m3pi.stop(); } /* sensor_value4 = sensor_all(4); // sensor_value gets fkt value