University of Plymouth - Stages 1, 2 and 3 / Mbed OS Task137

Fork of Task137 by Nicholas Outram

Files at this revision

API Documentation at this revision

Comitter:
noutram
Date:
Tue Sep 29 11:25:21 2015 +0000
Child:
1:f5c439cee163
Commit message:
Initial version

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	Tue Sep 29 11:25:21 2015 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+
+Serial pc(SERIAL_TX, SERIAL_RX);
+
+char nameStr[30]; // array of chars (string)
+int age;          // integer to hold your age
+
+void getData() 
+{
+   pc.scanf("%s %d", &nameStr, &age);
+}
+
+int main()
+{
+   getData();
+   
+   pc.printf("Hello %s \n\r", nameStr);
+   pc.printf("You are %d \n", age);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Sep 29 11:25:21 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa
\ No newline at end of file