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.
Revision 0:b1e04d4268b3, committed 2015-04-20
- Comitter:
- kumaresh
- Date:
- Mon Apr 20 10:58:58 2015 +0000
- Commit message:
- serial output control using switch
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 Mon Apr 20 10:58:58 2015 +0000
@@ -0,0 +1,31 @@
+#include "mbed.h"
+
+//------------------------------------
+// Hyperterminal configuration
+// default 9600 bauds, 8-bit data, no parity
+
+//Arduino pin D0 & D1 is disconnected by default in nucleo board and hence serial O/P or I/P will not work.
+// REFER ST USER MANUAL UM 1724
+
+//O/P/ or I/P will work in ST link(USB to serial virtual com port) or can also be used from CN3 connector of nucleo board.
+// use any terminal software and open the COM port of ST link to see the output.
+//------------------------------------
+
+Serial pc(SERIAL_TX, SERIAL_RX);
+DigitalIn sw1( PC_13); // refer UM1724 ST nucleo User manual for pin details
+
+
+DigitalOut myled(LED1);
+
+int main() {
+ int i = 1;
+ pc.printf("Hello World !\n");
+ while(1) {
+ if (sw1 == 0) {
+ pc.printf("count = %d.\n", i++);
+ myled = !myled;
+ while(!sw1); // wait till switch release
+ }
+ }
+}
+
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Apr 20 10:58:58 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/433970e64889 \ No newline at end of file