Degree Symbol Serial Monitor
Easy way to print the degree symbol on the Arduino Serial Monitor – In various applications, we sometimes need symbols that we want to display on the serial monitor.
For example, when we want to display a temperature of 10 degrees Celsius, we want to display 10 ° C.
As another example, if we want to display the resistance value of a resistance of 10 ohms, then we want it to look like 10Ω.
Arduino uses a character encoding with UTF-8 format.
UTF-8 (Universal Character Set (UCS) Transformation Format)
UTF-8 (Universal Character Set (UCS) Transformation Format) is a character encoding format developed by the Unicode Consortium that stores character data into binary data.
For example we store “hello”, the binary data is 01101000 01100101 01101100 01101100 01101111
UTF-8 is a character encoding that is widely used in web pages (html 5) and e-mails of 1 to 4 bytes in size.
Well, speaking of the Unicode Consortium, they are a non-profit company devoted to developing, maintaining and promoting software internationalization standards and data, especially the Unicode Standards, which define the representation of text in all modern software products and standards.
The Unicode Consortium is actively developing standards in the field of internationalization including defining the behavior and relationships between Unicode characters.
The consortium works closely with the W3C and with ISO and IEC – in particular with ISO / IEC / JTC 1 / SC2 / WG2, which is responsible for maintaining ISO / IEC 10646, the International Standard in sync with the Unicode Standard.
UTF-8 Kode CHARACTER EXPLANATION \xc2\xa0 NO-BREAK SPACE \xc2\xa1 ¡ INVERTED EXCLAMATION MARK \xc2\xa2 ¢ CENT SIGN \xc2\xa3 £ POUND SIGN \xc2\xa4 ¤ CURRENCY SIGN \xc2\xa5 ¥ YEN SIGN \xc2\xa6 ¦ BROKEN BAR \xc2\xa7 § SECTION SIGN \xc2\xa8 ¨ DIAERESIS \xc2\xa9 © COPYRIGHT SIGN \xc2\xaa ª FEMININE ORDINAL INDICATOR \xc2\xab « LEFT-POINTING DOUBLE ANGLE QUOTATION MARK \xc2\xac ¬ NOT SIGN \xc2\xad SOFT HYPHEN \xc2\xae ® REGISTERED SIGN \xc2\xaf ¯ MACRON \xc2\xb0 ° DEGREE SIGN \xc2\xb1 ± PLUS-MINUS SIGN \xc2\xb2 ² SUPERSCRIPT TWO \xc2\xb3 ³ SUPERSCRIPT THREE \xc2\xb4 ´ ACUTE ACCENT \xc2\xb5 µ MICRO SIGN \xc2\xb6 ¶ PILCROW SIGN \xc2\xb7 · MIDDLE DOT \xc2\xb8 ¸ CEDILLA \xc2\xb9 ¹ SUPERSCRIPT ONE \xc2\xba º MASCULINE ORDINAL INDICATOR \xc2\xbb » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK \xc2\xbc ¼ VULGAR FRACTION ONE QUARTER \xc2\xbd ½ VULGAR FRACTION ONE HALF \xc2\xbe ¾ VULGAR FRACTION THREE QUARTERS \xc2\xbf ¿ INVERTED QUESTION MARK \xc3\x80 À LATIN CAPITAL LETTER A WITH GRAVE \xc3\x81 Á LATIN CAPITAL LETTER A WITH ACUTE \xc3\x82 Â LATIN CAPITAL LETTER A WITH CIRCUMFLEX \xc3\x83 Ã LATIN CAPITAL LETTER A WITH TILDE \xc3\x84 Ä LATIN CAPITAL LETTER A WITH DIAERESIS \xc3\x85 Å LATIN CAPITAL LETTER A WITH RING ABOVE \xc3\x86 Æ LATIN CAPITAL LETTER AE \xc3\x87 Ç LATIN CAPITAL LETTER C WITH CEDILLA \xc3\x88 È LATIN CAPITAL LETTER E WITH GRAVE \xc3\x89 É LATIN CAPITAL LETTER E WITH ACUTE \xc3\x8a Ê LATIN CAPITAL LETTER E WITH CIRCUMFLEX \xc3\x8b Ë LATIN CAPITAL LETTER E WITH DIAERESIS \xc3\x8c Ì LATIN CAPITAL LETTER I WITH GRAVE \xc3\x8d Í LATIN CAPITAL LETTER I WITH ACUTE \xc3\x8e Î LATIN CAPITAL LETTER I WITH CIRCUMFLEX \xc3\x8f Ï LATIN CAPITAL LETTER I WITH DIAERESIS \xc3\x90 Ð LATIN CAPITAL LETTER ETH \xc3\x91 Ñ LATIN CAPITAL LETTER N WITH TILDE \xc3\x92 Ò LATIN CAPITAL LETTER O WITH GRAVE \xc3\x93 Ó LATIN CAPITAL LETTER O WITH ACUTE \xc3\x94 Ô LATIN CAPITAL LETTER O WITH CIRCUMFLEX \xc3\x95 Õ LATIN CAPITAL LETTER O WITH TILDE \xc3\x96 Ö LATIN CAPITAL LETTER O WITH DIAERESIS \xc3\x97 × MULTIPLICATION SIGN \xc3\x98 Ø LATIN CAPITAL LETTER O WITH STROKE \xc3\x99 Ù LATIN CAPITAL LETTER U WITH GRAVE \xc3\x9a Ú LATIN CAPITAL LETTER U WITH ACUTE \xc3\x9b Û LATIN CAPITAL LETTER U WITH CIRCUMFLEX \xc3\x9c Ü LATIN CAPITAL LETTER U WITH DIAERESIS \xc3\x9d Ý LATIN CAPITAL LETTER Y WITH ACUTE \xc3\x9e Þ LATIN CAPITAL LETTER THORN \xc3\x9f ß LATIN SMALL LETTER SHARP S \xc3\xa0 à LATIN SMALL LETTER A WITH GRAVE \xc3\xa1 á LATIN SMALL LETTER A WITH ACUTE \xc3\xa2 â LATIN SMALL LETTER A WITH CIRCUMFLEX \xc3\xa3 ã LATIN SMALL LETTER A WITH TILDE \xc3\xa4 ä LATIN SMALL LETTER A WITH DIAERESIS \xc3\xa5 å LATIN SMALL LETTER A WITH RING ABOVE \xc3\xa6 æ LATIN SMALL LETTER AE \xc3\xa7 ç LATIN SMALL LETTER C WITH CEDILLA \xc3\xa8 è LATIN SMALL LETTER E WITH GRAVE \xc3\xa9 é LATIN SMALL LETTER E WITH ACUTE \xc3\xaa ê LATIN SMALL LETTER E WITH CIRCUMFLEX \xc3\xab ë LATIN SMALL LETTER E WITH DIAERESIS \xc3\xac ì LATIN SMALL LETTER I WITH GRAVE \xc3\xad í LATIN SMALL LETTER I WITH ACUTE \xc3\xae î LATIN SMALL LETTER I WITH CIRCUMFLEX \xc3\xaf ï LATIN SMALL LETTER I WITH DIAERESIS \xc3\xb0 ð LATIN SMALL LETTER ETH \xc3\xb1 ñ LATIN SMALL LETTER N WITH TILDE \xc3\xb2 ò LATIN SMALL LETTER O WITH GRAVE \xc3\xb3 ó LATIN SMALL LETTER O WITH ACUTE \xc3\xb4 ô LATIN SMALL LETTER O WITH CIRCUMFLEX \xc3\xb5 õ LATIN SMALL LETTER O WITH TILDE \xc3\xb6 ö LATIN SMALL LETTER O WITH DIAERESIS \xc3\xb7 ÷ DIVISION SIGN \xc3\xb8 ø LATIN SMALL LETTER O WITH STROKE \xc3\xb9 ù LATIN SMALL LETTER U WITH GRAVE \xc3\xba ú LATIN SMALL LETTER U WITH ACUTE \xc3\xbb û LATIN SMALL LETTER U WITH CIRCUMFLEX \xc3\xbc ü LATIN SMALL LETTER U WITH DIAERESIS \xc3\xbd ý LATIN SMALL LETTER Y WITH ACUTE \xc3\xbe þ LATIN SMALL LETTER THORN \xc3\xbf ÿ LATIN SMALL LETTER Y WITH DIAERESIS
For details, click here. Now that we know the UTF-8 code above, let’s see an example of how to use it.
Displaying characters and symbols on the serial monitor Code Program
For writing the basic syntax of UTF-8 is: Serial.print (“UTF-8 code”).
We will try to display the following data:
- 10 degrees centigrade
- 90 degree angle
- 10 ohms
- 10 micro
- 10 percent
- Nokia Registered
To be like:
- 10 ℃
- 90 °
- 10 Ω
- 10 µ
- 10%
- Nokia®
Code Program For Show Degree Symbol Serial Monitor
The program is:
void setup() {
Serial.begin(9600);
Serial.println("10\xe2\x84\x83");
Serial.println("90\xc2\xb0");
Serial.println("10\xce\xa9");
Serial.println("10\xce\xbc");
Serial.println("10\x25");
Serial.println("Nokia\xc2\xae");
}
void loop() {
// put your main code here, to run repeatedly:
}
Results:
Hopefully this article can be useful for all. If you find this article useful, please share it using the share button below.