Seeedstudio Arch Examples : GPIO - Blinking LED

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 /* Configure a GPIO pin as output for controlling a LED. 'led' is user assigned name and
00004  'LED1' is a internal name given to a port pin P1_8 in this Arch platform. */
00005 DigitalOut led(LED1);
00006 
00007 int main()
00008 {
00009     while(1) {
00010         led = 1;    // Switch ON the LED.
00011         wait(0.5);  // Wait for 0.5 Seconds.
00012         led = 0;    // Switch OFF the LED.
00013         wait(0.5);  // Wait for 0.5 Seconds.
00014     }
00015 }