10 years, 7 months ago.

FOR loop

Can we for loop for blinking the leds?

1 Answer

10 years, 7 months ago.

Do you mean something like this:

Simple LED blinking

#include "mbed.h"

DigitalOut  led1(LED_RED);

int main() {

while(1)
     {
       led1=!led1;
       wait_ms(200);
     }

}

Yes!..pretty much like this. I also figured it out! Thanks for your help dude!

posted by Deepit Abhishek 18 Feb 2015