Shop OBEX P1 Docs P2 Docs Learn Events
X-Band 32213 how i can read speed ? — Parallax Forums

X-Band 32213 how i can read speed ?

ronaldo1ronaldo1 Posts: 3
edited 2013-11-02 15:32 in Accessories
Hi, (sorry for my English)

I use the X-Band sensor whith Arduino (by serial port) and i can see the motion but i can't read the speed, how i can do it ?



Thanks.

Whith this program i alaways pulseCount = 1

int xPin = 4;

void setup() {
Serial.begin(57600);
Serial.println("Pulse test");

pinMode(xPin, INPUT);
attachInterrupt(0, intHandler, RISING);
}

volatile int pulseCount = 0;

void intHandler() {
pulseCount++;
}

void loop() {
Serial.print("MOTION! ");
Serial.println(pulseCount);
delay(250);
}

Comments

Sign In or Register to comment.