Dead Ultrasonic Sensor


#1

I’ve been trying to get the ultrasonic sensor to work but to no avail. I’ve read through all the related topics I can find on here, tried all the ports, ran various examples, checked to make sure it has power (LED is red) but no matter what the sensor always returns 0.

Is there a way to test the sensor itself to see if it’s not just a defective sensor?

When I run the factory sketch and go into the ultrasonic sensor mode (D on the remote), the wheels just spin backwards. When I load the example sensor test, serial always outputs zero as well…

#include "MeOrion.h"

MeUltrasonicSensor ultraSensor(PORT_3); /* Ultrasonic module can ONLY be connected to port 3, 4, 6, 7, 8 of base shield. */

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  Serial.print("Distance : ");
  Serial.print(ultraSensor.distanceCm() );
  Serial.println(" cm");
  delay(100); /* the minimal measure interval is 100 milliseconds */
}

I’m using mBlock v3.2.2 with the starter robot kit - http://www.makeblock.cc/starter-robot-kit/ - sensor version is 3.0


#2