ADI_CAC / Mbed OS Blinky_Led2

Fork of Blinky_Led2 by Rohan Gurav

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /*
00002 Created on: 12/05/2018
00003 Source: (Self)
00004 Code: This code toggles the status of the onboard leds with a count-down 
00005 */
00006 
00007 #include "mbed.h"
00008 
00009 DigitalOut led2(P2_10);
00010 DigitalOut led1(LED1);
00011 Serial pc(USBTX, USBRX);
00012 int16_t i = 3;
00013 
00014 // main() runs in its own thread in the OS
00015 int main()
00016 {
00017     led1 = 1;
00018     led2 = 0;
00019 
00020     while (true) {
00021         led2 = !led2;
00022         led1 = !led1;
00023         wait(0.5);
00024         pc.printf("Toggle in : \r\n");
00025         for (i = 1; i <= 3; i++) 
00026         {
00027             pc.printf("%d\n",(i));
00028         }
00029     }
00030 }
00031