Demo Program for the Parallax X-Band Motion detector.

Dependencies:   Parallax_X-Band mbed

main.cpp

Committer:
ottaviano3
Date:
2015-03-08
Revision:
0:207fde6d4312
Child:
1:f03e66b92d1d

File content as of revision 0:207fde6d4312:

#include "mbed.h"
#include "Parallax_X-Band.h"

Serial pc(USBTX, USBRX);

xband myxband(p26, p25);

int main()
{
    // Enable the motion detector.
    myxband.enable(true);

    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());
        }
    }
}