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.
Dependencies: mbed Blinker TextLCD
Revision 0:fdb33524a029, committed 2017-01-07
- Comitter:
- jurgis
- Date:
- Sat Jan 07 12:47:40 2017 +0000
- Child:
- 1:b95c3509df0f
- Commit message:
- Initial commit
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat Jan 07 12:47:40 2017 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+
+DigitalOut led1(LED1);
+DigitalOut greenLed(D8);
+DigitalIn button(D9);
+Serial pc(USBTX, USBRX);
+
+double ledWait = 0.2; // sec
+
+double getWaitTime()
+{
+ double waitTime = (button == 0) ? 0.2 : 1.0;
+ pc.printf("waitTime: %0.1f\r\n", waitTime);
+ return waitTime;
+}
+
+int main()
+{
+ greenLed = 0;
+ pc.baud(115200);
+ pc.printf("Hello world\r\n");
+
+ while(1)
+ {
+ pc.printf("ON\r\n");
+ led1 = 1; // LED is ON
+ greenLed = 0;
+
+ wait(getWaitTime());
+
+ pc.printf("OFF\r\n");
+ led1 = 0; // LED is OFF
+ greenLed = 1;
+
+ wait(getWaitTime());
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Jan 07 12:47:40 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/99b5ccf27215 \ No newline at end of file