Echos ASCII message converted to uppercase. Uses toupper function from standard C library.

Dependencies:   mbed

Revision:
4:0ed7a3594910
Parent:
3:041d6aaa4a7b
--- a/main.cpp	Sat Jan 19 19:49:17 2019 +0000
+++ b/main.cpp	Mon Feb 11 18:51:56 2019 +0000
@@ -11,6 +11,7 @@
     Serial port - Data 8 bit, Parity none, Stop 1 bit, Flow control none.
     Baud as specified below.
 */
+#include <cctype>
 #include "mbed.h"
 
 Serial pc(USBTX, USBRX, 9600); // Standard to PC via USB channel.
@@ -21,8 +22,9 @@
 {
     while (true) {
         if (pc.readable()) {
-            char character = (char) pc.getc(); // Get a char from the PC.
-            pc.putc(character); // Send it back to the PC.
+            char myChar = (char) pc.getc(); // Get a char from the PC.            
+            myChar = std::toupper(myChar);
+            pc.putc(myChar); // Send it back to the PC.
             actLED = !actLED; // Toggle the activity LED.
         }
     }