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
Diff: main.cpp
- Revision:
- 0:94cb0da877bc
- Child:
- 1:1d27be3b634d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Sep 07 20:54:08 2016 +0000
@@ -0,0 +1,33 @@
+#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);
+ }
+}
\ No newline at end of file
