HB100 Microwave sensor code

I’ve encountered some sort of error while using the HB100 sensor.

I’m using a Arduino Genuino Uno.

I am using the listed code.

#include <FreqPeriod.h>

double lfrq;
long int pp;

void setup() {
Serial.println(“FreqPeriod Library Test”);

void loop() {
pp = FreqPeriod::getPeriod();
if (pp) {
Serial.print ("period: “);
Serial.print(” 1/16us / frequency: ");

lfrq = 16000400.0 /pp;
Serial.print(" Hz ");
Serial.println( " Mph ");

The code is supposed to use the microwave sensor to detect movement and calculate the speed in miles per hour continuously. However, the code only lists one result before freezing up. I am not sure what the problem is.

I'd have a closer look at the frequency counter library documentation.

And please remember to use code tags when posting code