updated for mbed-os 5.5

Fork of Task121 by Nicholas Outram

main.cpp

Committer:
noutram
Date:
2020-07-16
Revision:
11:d7337ffe7f85
Parent:
9:5ac40ff61514
Child:
12:991c54e21f5f

File content as of revision 11:d7337ffe7f85:

// Updated 2019 for Mbed-os 5.1X

//This is known as a “header file”
//In short, this copies and pastes the text file
//mbed.h into this code
#include "mbed.h"

//Create a DigitalOut “object” called myled
//Pass constant LED1 as a “parameter”
DigitalOut myled(LED1);

//The main function - all executable C / C++
//applications have a main function. This is
//out entry point in the software
int main() {

// ALL the code is contained in a 
// “while loop”
    while(1) 
    {
    //The code between the { curly braces }
    //is the code that is repeated  
        myled = 1; // External LED is ON
        wait_us(1000000); // 1 second
        myled = 0; // LED is OFF
        wait_us(1000000); // External 1 second
    }
}