The example program for mbed pin-compatible platforms

main.cpp

Committer:
bosko001
Date:
2020-02-06
Revision:
25:966cef6183e9
Parent:
24:7f14b70fc9ef

File content as of revision 25:966cef6183e9:

#include "mbed.h"



DigitalOut RedLed(LED1);
DigitalOut GreenLed(LED2);
DigitalOut BlueLed(LED3);
int main() {

Serial pc(USBTX, USBRX); // tx, rx




    RedLed =1;
    GreenLed = 1;
    BlueLed = 1;
    
    while(1) {

    pc.printf("Hello World!\n\r");


        RedLed = 0;
        wait(0.5);
        RedLed = 1;
        wait(1);
        
        GreenLed=0;
        wait(2);
        GreenLed=1;
        wait(1);
        
        BlueLed = 0;
        wait(0.5);
        BlueLed = 1;
        wait(1);
    }
}