Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 11 months ago.
Why wait() is not working?
Here is a simple code:
#include "mbed.h" DigitalOut sclk(p6); int main() { while(1) { sclk = 1; wait(0.05); sclk = 0; wait(0.05); } }
When I check the timing from logic analyzer, sclk will rise then fall right after, which only takes 1us, the rest of period will be low. Why sclk can't stay high for 0.05s?
2 Answers
11 years, 11 months ago.
I just tested it by setting the sclk output to a LED and watching it (not a logic analyzer atm here), and it operates fine, it definately is high longer than 1us. Also since I dont see any reason why it wouldnt work, my guess is that you got something wrong with your logic analyzer.