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.
whiteText.cpp@117:e072f162cbce, 2021-10-17 (annotated)
- Committer:
- CSTritt
- Date:
- Sun Oct 17 13:54:15 2021 +0000
- Revision:
- 117:e072f162cbce
- Parent:
- 116:8990686eedf5
Cleaned up comments.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| CSTritt | 116:8990686eedf5 | 1 | /* File: whiteText.cpp |
| CSTritt | 116:8990686eedf5 | 2 | |
| CSTritt | 116:8990686eedf5 | 3 | This function uses ANSI/VT100 escapse sequences to change text to blue. Serial |
| CSTritt | 116:8990686eedf5 | 4 | object must be passed by reference (since it is physically unique and can't be |
| CSTritt | 116:8990686eedf5 | 5 | copied). The call will look normal as does the usage of pc here. |
| CSTritt | 116:8990686eedf5 | 6 | |
| CSTritt | 116:8990686eedf5 | 7 | Created by Dr. C. S. Tritt |
| CSTritt | 116:8990686eedf5 | 8 | Last revised: 10/16/21 (v. 1.0) |
| CSTritt | 116:8990686eedf5 | 9 | */ |
| CSTritt | 116:8990686eedf5 | 10 | |
| CSTritt | 116:8990686eedf5 | 11 | // Need for mbed use. |
| CSTritt | 116:8990686eedf5 | 12 | #include "mbed.h" |
| CSTritt | 116:8990686eedf5 | 13 | |
| CSTritt | 116:8990686eedf5 | 14 | // Including the myFuncs.h header here will catch mismatches between the |
| CSTritt | 116:8990686eedf5 | 15 | // declaration and the definition. |
| CSTritt | 116:8990686eedf5 | 16 | #include "myFuncs.h" |
| CSTritt | 116:8990686eedf5 | 17 | |
| CSTritt | 116:8990686eedf5 | 18 | void whiteText(Serial & pc) |
| CSTritt | 116:8990686eedf5 | 19 | { |
| CSTritt | 116:8990686eedf5 | 20 | const char ESC = 27; // Define escape character for escape sequence. |
| CSTritt | 116:8990686eedf5 | 21 | pc.printf("%c[37m", ESC); // ANSI/VT100 white text. |
| CSTritt | 116:8990686eedf5 | 22 | } |