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.
Diff: main.cpp
- Revision:
- 0:eef6d081aebe
- Child:
- 1:203c68bc3e88
diff -r 000000000000 -r eef6d081aebe main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Feb 16 17:08:12 2017 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+//InterruptIn event(PA_10/*USER_BUTTON*/);
+
+volatile int updatedLED = 0;
+
+
+void ButtonPressed(void) {
+ myled = !myled;
+ updatedLED++;
+}
+
+int main()
+{
+ //Serial ser(USBTX, USBRX);
+ //ser.baud(230400);
+ //event.fall(&ButtonPressed);
+ // event.mode(PullUp);
+ int intrnos = 0;
+
+ //ser.printf("Hello, World\r\n");
+ int i = 0;
+ for(;;) {
+ while(i < 5) {
+ myled = 1; // LED is ON
+ wait(0.2); // 200 ms
+ myled = 0; // LED is OFF
+ wait(1.0); // 1 sec
+ i++;
+ }
+ sleep();
+ //ser.printf("Wakeup: %d LED: %d\r\n", ++intrnos, updatedLED);
+ }
+}