Demo Program for the Parallax X-Band Motion detector.
Dependencies: Parallax_X-Band mbed
Revision 1:f03e66b92d1d, committed 2015-03-09
- Comitter:
- ottaviano3
- Date:
- Mon Mar 09 20:16:18 2015 +0000
- Parent:
- 0:207fde6d4312
- Commit message:
- Updated parallax library.
Changed in this revision
Parallax_X-Band.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 207fde6d4312 -r f03e66b92d1d Parallax_X-Band.lib --- a/Parallax_X-Band.lib Sun Mar 08 20:03:06 2015 +0000 +++ b/Parallax_X-Band.lib Mon Mar 09 20:16:18 2015 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/users/ottaviano3/code/Parallax_X-Band/#6e294a3a74f8 +http://developer.mbed.org/users/ottaviano3/code/Parallax_X-Band/#efdfdab29a20
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