10 years, 1 month ago.

urgent question

give me a program for led with switch case with led 1 blinking and it should show in the computer

Is that a question or a request that someone else does your homework for you?

posted by Andy A 21 Sep 2015

1 Answer

10 years ago.

Is this what you mean?

led1 blinking with pc serial terminal output

#include "mbed.h"

DigitalOut led(LED1);

Serial pc(USBTX, USBRX);

int main() {  

    while (true) {       
        
        led=1;       
        pc.printf("LED = 'on'\n"); 
        
        wait(1);
        
        led=0;        
        pc.printf("LED = 'off'\n");
        
        wait(1);
    }
}