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.
Dependencies: Movement mbed tunes motor pwm_tone clickers Ultra
Diff: main.cpp
- Revision:
- 12:15272c2ae2ed
- Parent:
- 9:1094da23254d
- Child:
- 13:13f14a8a902b
--- a/main.cpp Fri Mar 06 17:00:54 2020 +0000
+++ b/main.cpp Tue Mar 17 13:13:57 2020 +0000
@@ -19,6 +19,7 @@
#include "UltraSonic.h"
#include "tunes.h"
#include "clickers.h"
+#include "Movement.h"
#define TIME_PERIOD 2 //Constant compiler Values here 2 equates to 2ms or 500Hz base Frequency
#define DUTY 0.9 //DUTY of 1.0=100%, 0.4=40% etc.,
@@ -34,8 +35,10 @@
//This is Pseudo RS232 over USB the NUCLEO will appear as a COMx Port see device Manager on PC used
//Use PuTTY to monitor check COMx and BAUD rate (115200)
int mm;
+int HallState = 0;
bool fStopped, rStopped = false;
void dist(){
+ ultra_sonic_distance();
mm = (int)GetDistance();
}
int main ()
@@ -61,10 +64,6 @@
while(true) //Repeat the following forever NB always true!
{
- dist();
-
- ultra_sonic_distance();
- RevStop();
- FwdStop();
+ Direction();
} // go back to start of while loop
} //end of int main()