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
Revision 1:76207e762bb4, committed 2018-06-17
- Comitter:
- rakeshravula
- Date:
- Sun Jun 17 10:59:50 2018 +0000
- Parent:
- 0:4a2f7ded5c1d
- Commit message:
- modified for ports
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 4a2f7ded5c1d -r 76207e762bb4 main.cpp
--- a/main.cpp Sun Jun 17 08:22:58 2018 +0000
+++ b/main.cpp Sun Jun 17 10:59:50 2018 +0000
@@ -1,16 +1,21 @@
#include "mbed.h"
-
-Serial pc(USBTX, USBRX);
-
-DigitalOut led1(LED1);
-
-int main() {
- while (true) {
- led1 = !led1;
-
- // Print something over the serial connection
- pc.printf("Blink! LED is now %d\r\n", led1.read());
-
- wait(0.5);
+
+//------------------------------------
+// Hyperterminal configuration
+// 9600 bauds, 8-bit data, no parity
+//------------------------------------
+
+Serial pc(PC_6, PC_7);
+
+DigitalOut myled(PD_14);
+
+int main()
+{
+ int i = 1;
+ pc.printf("Hello World !\n");
+ while(1) {
+ wait(1);
+ printf("This program runs since %d seconds.\n", i++);
+ myled = !myled;
}
}
\ No newline at end of file