![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
First Draft, serial print change based on distance
Diff: main.cpp
- Revision:
- 14:837945ccd8c0
- Parent:
- 13:cc99df342c7f
- Child:
- 15:d8ff594535fc
--- a/main.cpp Thu Feb 03 21:43:40 2022 +0000 +++ b/main.cpp Thu Feb 03 21:58:22 2022 +0000 @@ -2,6 +2,7 @@ #include "ultrasonic.h" #include "N5110.h" #include "Joystick.h" +#include "beep.h" #include "main.h" /***************************************************************************//** @@ -336,6 +337,10 @@ Distance1 = mu.getCurrentDistance(); + buzzer.beep(1000,2); + wait(0.5); + buzzer.beep(0,0); + printf("distance at sense 1 = %d\r\n", Distance1); } @@ -345,6 +350,10 @@ sense = 2; Distance2 = mu.getCurrentDistance(); + + buzzer.beep(1000,2); + wait(0.5); + buzzer.beep(0,0); printf("distance at sense 2 = %d\r\n", Distance2); @@ -355,6 +364,10 @@ sense = 3; Distance3 = mu.getCurrentDistance(); + + buzzer.beep(1000,2); + wait(0.5); + buzzer.beep(0,0); printf("distance at sense 3 = %d\r\n", Distance3); @@ -365,6 +378,10 @@ sense = 4; Distance4 = mu.getCurrentDistance(); + + buzzer.beep(1000,2); + wait(0.5); + buzzer.beep(0,0); printf("distance at sense 4 = %d\r\n", Distance4); @@ -376,6 +393,10 @@ Distance5 = mu.getCurrentDistance(); + buzzer.beep(1000,2); + wait(0.5); + buzzer.beep(0,0); + printf("distance at sense 5 = %d\r\n", Distance5); } @@ -386,6 +407,10 @@ Distance6 = mu.getCurrentDistance(); + buzzer.beep(1000,2); + wait(0.5); + buzzer.beep(0,0); + printf("distance at sense 6 = %d\r\n", Distance6); }