Charles Tritt
/
SerialEcho_UC
Echos ASCII message converted to uppercase. Uses toupper function from standard C library.
Diff: main.cpp
- Revision:
- 3:041d6aaa4a7b
- Parent:
- 2:e53dfe50252a
- Child:
- 4:0ed7a3594910
--- a/main.cpp Thu Jan 17 19:57:50 2019 +0000 +++ b/main.cpp Sat Jan 19 19:49:17 2019 +0000 @@ -2,7 +2,7 @@ Project: SerialEcho File: main.cpp Created by: Dr. C. S. Tritt - Last revised: 1/17/19 + Last revised: 1/17/19 (v. 1.0) Receives serial data from PC to and echos it back, character for character. @@ -15,16 +15,15 @@ Serial pc(USBTX, USBRX, 9600); // Standard to PC via USB channel. -DigitalOut actLED(LED1); // Activity toggle. +DigitalOut actLED(LED1); // Activity LED. int main() { while (true) { if (pc.readable()) { - char character = (char) pc.getc(); - //pc.putc(character); - pc.putc(character); - actLED = !actLED; + char character = (char) pc.getc(); // Get a char from the PC. + pc.putc(character); // Send it back to the PC. + actLED = !actLED; // Toggle the activity LED. } } } \ No newline at end of file