3 years, 10 months ago.

Simple code not working


I have tried to get this simple code working on the mbed LPC1768. I tried this at university, and it worked perfectly. It compiles and downloads, and sits on the mbed without a problem, but then the mbed doesn't carry out the programme once it is reset.

  1. include "mbed.h" DigitalOut myled(LED2); int main() { while(1) { myled = 1; wait(0.2); myled = 0; wait(0.2); } }

Thanks in advance Rob

1 Answer

3 years, 10 months ago.

I have three suggestions for debugging

1. Reflash the mBed interface to be sure that it is up to date. 2. Try using a different LED rather than LED2. 3. Try using a longer wait time.

- Bill Den Beste

Happy to help you further if these suggestions don't provide any help. Hopefully you have a voltmeter.

Accepted Answer

For reflashing the firmware, check out this page:


posted by Bill Den Beste 20 Aug 2016

Apologies for not responding for a year, but circumstances meant that I only managed to work on this recently. I found out what the problem was. I wasn't waiting for the code to flash to the mbed before resetting. Once I'd waited for the mbed to finish accepting the code, and then resetting it, it worked perfectly. Thanks for your help.

posted by Robert Walker 03 Feb 2018