Ultrasound module problem


#21

Hello
firstly thank you for your answer.

I try this code arduino 1.6.5 but not work again.

Is my ultrasensor broken ? But I buy new a mount before.I have to make a project students but ı cant.My student want to make a project a lot.

What kind of projects proposal for me?


#22

I posted this because the code provided by Makeblock doesn’t compile.I wish Makeblock would make sure that the code, version, and examples work, especially since the Makeblock products are designed for mostly school kids trying to learn basic coding.

If you sell a product like this then you should make sure it works, and with what hardware, operating system it was successfully tested on. I don’t think this is too much to ask!


#23

@eesmed,

Try this instead. I copied some code from Makeblocks UltrasonicSensorTest.uno and modified it with some code from mBlock.

#include <MeMCore.h> //This is from mBlock
MeUltrasonicSensor ultraSensor(PORT_3); //mBot port
void setup()
{
  Serial.begin(9600);
}
void loop()
{
  Serial.print("Distance : ");
  Serial.print(ultraSensor.distanceCm());
  Serial.println(" cm");
  delay(100);
}

This should run on the mBot with the Ultrasonic on port _3. I tested on Win10 with Arduino 1.6.7. The board is set to Arduino/Genuino Uno. Launch the serial monitor to see results.

I hope this helps,

Mike


#24