Initial version

Fork of Task136 by Nicholas Outram

Files at this revision

API Documentation at this revision

Comitter:
noutram
Date:
Wed Sep 11 13:46:00 2019 +0000
Parent:
1:99582c31348a
Child:
3:c28e88869b5a
Commit message:
2019

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
mbed_app.json Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Jul 13 14:47:15 2017 +0000
+++ b/main.cpp	Wed Sep 11 13:46:00 2019 +0000
@@ -1,18 +1,24 @@
 #include "mbed.h"
 
-PwmOut mypwm(PWM_OUT);
+Serial pc(SERIAL_TX, SERIAL_RX);
 
-DigitalOut myled(LED1);
+DigitalOut greenLed(LED1,0);
+DigitalOut blueLed(LED2,0);
+DigitalOut redLed(LED3,0);
 
 int main() {
+    char nameString[30];
+    int age;
     
-    mypwm.period_ms(10);
-    mypwm.pulsewidth_ms(1);
-  
-    printf("pwm set to %.2f %%\n", mypwm.read() * 100);
+    pc.printf("Enter your first name, then a space, then your age\n\r");
+    pc.scanf("%s %d", nameString, &age);
+    pc.printf("Hello %s\n\r", nameString);
+    pc.printf("You are %d years old\n\r", age);
     
-    while(1) {
-        myled = !myled;
-        wait(1);
-    }
+    //Loop forever
+    redLed = 1;
+    blueLed = 1;
+    greenLed = 1;    
+    while(1);
 }
+
--- a/mbed-os.lib	Thu Jul 13 14:47:15 2017 +0000
+++ b/mbed-os.lib	Wed Sep 11 13:46:00 2019 +0000
@@ -1,1 +1,1 @@
-https://github.com/ARMmbed/mbed-os/#8828635da469162cf2854b5287561c663fb96e72
+https://github.com/ARMmbed/mbed-os/#1bf6b20df9d3cd5f29f001ffc6f0d0fcbbb96118
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed_app.json	Wed Sep 11 13:46:00 2019 +0000
@@ -0,0 +1,3 @@
+{
+    "requires": ["bare-metal"]
+}
\ No newline at end of file