9 years, 4 months ago.

repeating code from the start

/media/uploads/TMorgz/mbed_led_lpc1768_-2-.bin The above code works fine apart from the fact that it does not repeat from the start, basically the external led flashes (first bit of code) then the 4 on board leds flash (most of the code) but then it starts back with the on board leds not the external ones, please help !!!

1 Answer

9 years, 4 months ago.

We can't debug a binary file. Post the code or a link to the project please rather than the output of the compiler.

  1. include "mbed.h"

DigitalOut myled(p21); / Connect LED cathode to pin 21

int main() { while(1) { myled = 1; wait(1.0); myled = 0; wait(1.0); myled = 1; wait(0.5); myled = 0; wait(0.5);

DigitalOut myled1(LED1),myled4(LED4),myled3(LED3),myled2(LED2); while(1){ myled1 = 1; myled2 = 1; myled3 = 1; myled4 = 1; wait(0.2); myled1 = 0; myled2 = 0; myled3 = 0; myled4 = 0; wait(0.2); myled1 = 1; myled4 = 1; wait(0.2); myled1 = 0; myled4 = 0; wait(0.2); myled2 = 1; myled3 = 1; wait(0.2); myled2 = 0; myled3 = 0; wait(0.2); myled1 = 1; wait(0.1); myled1 = 0; wait(0.1); myled2 = 1; wait(0.1); myled2 = 0; wait(0.1); myled3 = 1; wait(0.1); myled3 = 0; wait(0.1); myled4 = 1; wait(0.1); myled4 = 0; wait(0.1); myled4 = 1; wait(0.1); myled4 = 0; wait(0.1); myled3 = 1; wait(0.1); myled3 = 0; wait(0.1); myled2 = 1; wait(0.1); myled2 = 0; wait(0.1); myled1 = 1; wait(0.1); myled1 = 0; wait(0.1); myled1 = 1; wait(0.1); myled1 = 0; wait(0.1); myled2 = 1; wait(0.1); myled2 = 0; wait(0.1); myled3 = 1; wait(0.1); myled3 = 0; wait(0.1); myled4 = 1; wait(0.1); myled4 = 0; wait(0.1); myled4 = 1; wait(0.1); myled4 = 0; wait(0.1); myled3 = 1; wait(0.1); myled3 = 0; wait(0.1); myled2 = 1; wait(0.1); myled2 = 0; wait(0.1); myled1 = 1; wait(0.1); myled1 = 0; wait(0.1);

DigitalOut myled(p21); / Connect LED cathode to pin 21

int main() ; while(1) myled = 1; wait(1.0); myled = 0; wait(1.0); myled = 1; wait(0.5); myled = 0; wait(0.5); } }}}

That is the code im new to this so if you would like anything else please just ask!

posted by Bob elderflower 17 Jul 2015