Zhen Liu / Mbed 2 deprecated HW1_extraB

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 // This program will blink LED1 and LED4
00003 // using assembly language for LED1 and
00004 // API functions for LED4
00005 // declare external assembly language function (in a *.s file)
00006 extern "C" int my_asm();
00007 // declare LED outputs – let C set them up as output bits
00008 DigitalIn sw(p5);
00009 DigitalOut led(p10);
00010 DigitalOut myled1(LED1);
00011 DigitalOut myled4(LED4);
00012  
00013 int main() {
00014     // loop forever
00015     while(1) {
00016       //call assembly language function to control LED1
00017       my_asm();
00018       wait(0.2);
00019     }
00020 }