'class Ultrasonic' has no member named 'MeasureInCentimeters'

Searching decision, but nowhere find it, so the problem is , when i verify my project , it writes "‘class Ultrasonic’ has no member named ‘MeasureInCentimeters’ "

full sketch i attached bellow.

thank you in advance.

U_arm_code.ino (8.16 KB)

Please post a link (using the chain links icon on the forum toolbar to make it clickable) to where you downloaded the Ultrasonic library from. Or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.

I'm guessing you found this U_arm_code sketch somewhere on the Internet, rather than having written it yourself. If so, please post a link to where you got that code from.

Code was taken from Slider-Examples/Slider.ino at master · uArm-Developer/Slider-Examples · GitHub

Ultrasonic-3.0.0.zip library from Ultrasonic - Arduino Libraries

pert:
Please post a link (using the chain links icon on the forum toolbar to make it clickable) to where you downloaded the Ultrasonic library from. Or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.

I'm guessing you found this U_arm_code sketch somewhere on the Internet, rather than having written it yourself. If so, please post a link to where you got that code from.

The problem is that the Slider sketch was written for a specific ultrasonic library, but you just grabbed a random library. Unsurprisingly, it was not compatible with the Slider code.

The Slider-Examples provides the library dependencies of the Slider sketch. These are the specific libraries that the code was written for.

It's quite unfortunate that the U-Arm people didn't bother to properly document how to use their Slider sketch. I can understand when a developer doesn't provide good documentation for a hobby project they wrote for fun as a volunteer. What I never can understand is when the software is supporting a commercial product that a company is trying to charge hundreds of dollars for and they won't spend a few minutes to provide a positive experience for the customers. Even if they don't care about doing the right thing, it would pay off financially very quickly by reducing the number of support requests. I see this all too often.

The first thing you need to do is delete the incorrect Ultrasonic library:

  • File > Examples > Ultrasonic > MultipleUltrasonicSensors
  • Sketch > Show sketch folder. This will open the MultipleUltrasonicSensors example sketch's folder.
  • Delete the root folder of the Ultrasonic library, which is two folder levels up from the MultipleUltrasonicSensors sketch folder.

Now you need to install the correct library:

The error from the Ultrasonic library will now be fixed. There were two other library dependencies in the lib folder and it's possible that you also installed the incorrect libraries for those. If so, you will need to adapt and repeat the above process for those libraries as well.

Error gone.

Respect for you :slight_smile:

pert:
The problem is that the Slider sketch was written for a specific ultrasonic library, but you just grabbed a random library. Unsurprisingly, it was not compatible with the Slider code.

The Slider-Examples provides the library dependencies of the Slider sketch. These are the specific libraries that the code was written for.

It's quite unfortunate that the U-Arm people didn't bother to properly document how to use their Slider sketch. I can understand when a developer doesn't provide good documentation for a hobby project they wrote for fun as a volunteer. What I never can understand is when the software is supporting a commercial product that a company is trying to charge hundreds of dollars for and they won't spend a few minutes to provide a positive experience for the customers. Even if they don't care about doing the right thing, it would pay off financially very quickly by reducing the number of support requests. I see this all too often.

The first thing you need to do is delete the incorrect Ultrasonic library:

  • File > Examples > Ultrasonic > MultipleUltrasonicSensors
  • Sketch > Show sketch folder. This will open the MultipleUltrasonicSensors example sketch's folder.
  • Delete the root folder of the Ultrasonic library, which is two folder levels up from the MultipleUltrasonicSensors sketch folder.

Now you need to install the correct library:

The error from the Ultrasonic library will now be fixed. There were two other library dependencies in the lib folder and it's possible that you also installed the incorrect libraries for those. If so, you will need to adapt and repeat the above process for those libraries as well.

I'm glad to hear it's working now. Enjoy!
Per