Demo Program for the Parallax X-Band Motion detector.
Dependencies: Parallax_X-Band mbed
Diff: main.cpp
- Revision:
- 1:f03e66b92d1d
- Parent:
- 0:207fde6d4312
diff -r 207fde6d4312 -r f03e66b92d1d main.cpp --- a/main.cpp Sun Mar 08 20:03:06 2015 +0000 +++ b/main.cpp Mon Mar 09 20:16:18 2015 +0000 @@ -9,12 +9,16 @@ { // Enable the motion detector. myxband.enable(true); + + // Variable to store read velocity. + float velocity; while(1) { // Wait for a new velocity value to be calculated. while (myxband.velocityack() == true) { // Once a new one is avaliable print it to the USB serial port. - pc.printf("Velocity: %f Ticks/sec\n\r",myxband.read_velocity()); + velocity = myxband; + pc.printf("Velocity: %f Ticks/sec\n\r",velocity); } } } \ No newline at end of file