Mbed Studio Wait

Hello, I just started using mbed studio today and when I was compiling my program I had an issue with the complier not recognizing the “wait” function. I have #include “mbed.h” in my program, is there any chance that it could be missing form my library? If so, how can I remedy the issue?

The error message:
Use of undeclared identifier ‘wait’

Hi Dylan,

I guess it is because your program is using Mbed OS 6+. wait() function was marked as deprecated in Mbed OS 5 and then removed in Mbed OS 6. Please replace it with either:

  • wait_ns()
  • wait_us()
  • ThisThread::sleep_for()

I recommend also using a built-in C/C++ IntelliSense. It should help you while coding. Please only remember to select a target and make the program active.

Thanks,
Arek - Mbed Studio team

2 Likes

Thank you.

I am also having an issue with sending code to my target, when I hit run program it will compile but nothing is sent to my board and everything will grey out.
So:
1: How do I stop the program running other than unplugging the controller?
2: Why isn’t the Studio sending code to my board?