Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of ECE_4180_Lab1_P1_Arm by
main.cpp
- Committer:
- zbraun6
- Date:
- 2016-09-07
- Revision:
- 0:94cb0da877bc
- Child:
- 1:1d27be3b634d
File content as of revision 0:94cb0da877bc:
#include "mbed.h"
// This program will blink LED1 and LED4
// using assembly language for LED1 and
// API functions for LED4
// declare external assembly language function (in a *.s file)
extern "C" int my_asm(int value);
// declare LED outputs – let C set them up as output bits
DigitalOut myled1(LED1);
DigitalOut myled4(LED4);
DigitalOut digOut(p30);
DigitalIn digIn(p21);
int main() {
int value = 0;
while(1) {
if (digIn) {
value = 1;
} else {
value = 0;
}
// loop forever
//call assembly language function to control LED1
my_asm(value);
//API function to control LED4
// myled4 = value;
// flip value and wait
wait(0.2);
}
}
