Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How do I print the degree character to Serial Output in VS/VM? (Read 3331 times)
hauwarea
Junior Member
**
Offline


Posts: 34
Location: Perth Western Australia
Joined: Apr 9th, 2017
How do I print the degree character to Serial Output in VS/VM?
Feb 24th, 2018 at 3:47am
Print Post  
VS/VM (so I believe) uses Consolas 10 as standard font.
I looked for the character in the character list and found it numbered U+00B0.  I don't understand the '+' so I declare a constant for the character as
const char DEGREE_CHARACTER = char(0xB0);
and try to write it to Serial Output with
Serial.write(DEGREE_CHARACTER);
I have also tried
Serial.print(DEGREE_CHARACTER);

Both of these give me a small diamond character which I do not recognize.

How do I print the degree character to Serial Output in VS/VM?

Thanks
  
Back to top
 
IP Logged
 
hauwarea
Junior Member
**
Offline


Posts: 34
Location: Perth Western Australia
Joined: Apr 9th, 2017
Re: How do I print the degree character to Serial Output in VS/VM?
Reply #1 - Feb 25th, 2018 at 6:36am
Print Post  
Yeah, well, ... this printed the characters
Code (C++)
Select All
void setup()
{
	Serial.begin(9600);

	for (int i; i < 256; i++)
	{
		Serial.print(char(i));
		Serial.print(" Decimal => ");
		Serial.print(i, DEC);
		Serial.print(" Hex => ");
		Serial.println(i, HEX);
	}
}

void loop()
{

} 



giving
Code (C++)
Select All
Opening port
Port open
=> 2 Hex => 2

 Decimal => 3 Hex => 3

 Decimal => 4 Hex => 4

 Decimal => 5 Hex => 5

 Decimal => 6 Hex => 6

 Decimal => 7 Hex => 7

 Decimal => 8 Hex => 8
	 Decimal => 9 Hex => 9

 Decimal => 10 Hex => A

 Decimal => 11 Hex => B

 Decimal => 12 Hex => C
 Decimal => 13 Hex => D

 Decimal => 14 Hex => E

 Decimal => 15 Hex => F

 Decimal => 16 Hex => 10

 Decimal => 17 Hex => 11

 Decimal => 18 Hex => 12

 Decimal => 19 Hex => 13

 Decimal => 20 Hex => 14

 Decimal => 21 Hex => 15

 Decimal => 22 Hex => 16

 Decimal => 23 Hex => 17

 Decimal => 24 Hex => 18

 Decimal => 25 Hex => 19

 Decimal => 26 Hex => 1A

 Decimal => 27 Hex => 1B

 Decimal => 28 Hex => 1C

 Decimal => 29 Hex => 1D

 Decimal => 30 Hex => 1E

 Decimal => 31 Hex => 1F
  Decimal => 32 Hex => 20
! Decimal => 33 Hex => 21
" Decimal => 34 Hex => 22
# Decimal => 35 Hex => 23
$ Decimal => 36 Hex => 24
% Decimal => 37 Hex => 25
& Decimal => 38 Hex => 26
' Decimal => 39 Hex => 27
( Decimal => 40 Hex => 28
) Decimal => 41 Hex => 29
* Decimal => 42 Hex => 2A
+ Decimal => 43 Hex => 2B
, Decimal => 44 Hex => 2C
- Decimal => 45 Hex => 2D
. Decimal => 46 Hex => 2E
/ Decimal => 47 Hex => 2F
0 Decimal => 48 Hex => 30
1 Decimal => 49 Hex => 31
2 Decimal => 50 Hex => 32
3 Decimal => 51 Hex => 33
4 Decimal => 52 Hex => 34
5 Decimal => 53 Hex => 35
6 Decimal => 54 Hex => 36
7 Decimal => 55 Hex => 37
8 Decimal => 56 Hex => 38
9 Decimal => 57 Hex => 39
: Decimal => 58 Hex => 3A
; Decimal => 59 Hex => 3B
< Decimal => 60 Hex => 3C
= Decimal => 61 Hex => 3D
> Decimal => 62 Hex => 3E
? Decimal => 63 Hex => 3F
@ Decimal => 64 Hex => 40
A Decimal => 65 Hex => 41
B Decimal => 66 Hex => 42
C Decimal => 67 Hex => 43
D Decimal => 68 Hex => 44
E Decimal => 69 Hex => 45
F Decimal => 70 Hex => 46
G Decimal => 71 Hex => 47
H Decimal => 72 Hex => 48
I Decimal => 73 Hex => 49
J Decimal => 74 Hex => 4A
K Decimal => 75 Hex => 4B
L Decimal => 76 Hex => 4C
M Decimal => 77 Hex => 4D
N Decimal => 78 Hex => 4E
O Decimal => 79 Hex => 4F
P Decimal => 80 Hex => 50
Q Decimal => 81 Hex => 51
R Decimal => 82 Hex => 52
S Decimal => 83 Hex => 53
T Decimal => 84 Hex => 54
U Decimal => 85 Hex => 55
V Decimal => 86 Hex => 56
W Decimal => 87 Hex => 57
X Decimal => 88 Hex => 58
Y Decimal => 89 Hex => 59
Z Decimal => 90 Hex => 5A
[ Decimal => 91 Hex => 5B\ Decimal => 92 Hex => 5C
] Decimal => 93 Hex => 5D
^ Decimal => 94 Hex => 5E
_ Decimal => 95 Hex => 5F
` Decimal => 96 Hex => 60
a Decimal => 97 Hex => 61
b Decimal => 98 Hex => 62
c Decimal => 99 Hex => 63
d Decimal => 100 Hex => 64
e Decimal => 101 Hex => 65
f Decimal => 102 Hex => 66
g Decimal => 103 Hex => 67
h Decimal => 104 Hex => 68
i Decimal => 105 Hex => 69
j Decimal => 106 Hex => 6A
k Decimal => 107 Hex => 6B
l Decimal => 108 Hex => 6C
m Decimal => 109 Hex => 6D
n Decimal => 110 Hex => 6E
o Decimal => 111 Hex => 6F
p Decimal => 112 Hex => 70
q Decimal => 113 Hex => 71
r Decimal => 114 Hex => 72
s Decimal => 115 Hex => 73
t Decimal => 116 Hex => 74
u Decimal => 117 Hex => 75
v Decimal => 118 Hex => 76
w Decimal => 119 Hex => 77
x Decimal => 120 Hex => 78
y Decimal => 121 Hex => 79
z Decimal => 122 Hex => 7A
{ Decimal => 123 Hex => 7B
| Decimal => 124 Hex => 7C
} Decimal => 125 Hex => 7D
~ Decimal => 126 Hex => 7E

 Decimal => 127 Hex => 7F
� Decimal => 128 Hex => 80
� Decimal => 129 Hex => 81
� Decimal => 130 Hex => 82
� Decimal => 131 Hex => 83
� Decimal => 132 Hex => 84
� Decimal => 133 Hex => 85
� Decimal => 134 Hex => 86
� Decimal => 135 Hex => 87
� Decimal => 136 Hex => 88
� Decimal => 137 Hex => 89
� Decimal => 138 Hex => 8A
� Decimal => 139 Hex => 8B
� Decimal => 140 Hex => 8C
� Decimal => 141 Hex => 8D
� Decimal => 142 Hex => 8E
� Decimal => 143 Hex => 8F
� Decimal => 144 Hex => 90
� Decimal => 145 Hex => 91
� Decimal => 146 Hex => 92
� Decimal => 147 Hex => 93
� Decimal => 148 Hex => 94
� Decimal => 149 Hex => 95
� Decimal => 150 Hex => 96
� Decimal => 151 Hex => 97
� Decimal => 152 Hex => 98
� Decimal => 153 Hex => 99
� Decimal => 154 Hex => 9A
� Decimal => 155 Hex => 9B
� Decimal => 156 Hex => 9C
� Decimal => 157 Hex => 9D
� Decimal => 158 Hex => 9E
� Decimal => 159 Hex => 9F
� Decimal => 160 Hex => A0
� Decimal => 161 Hex => A1
� Decimal => 162 Hex => A2
� Decimal => 163 Hex => A3
� Decimal => 164 Hex => A4
� Decimal => 165 Hex => A5
� Decimal => 166 Hex => A6
� Decimal => 167 Hex => A7
� Decimal => 168 Hex => A8
� Decimal => 169 Hex => A9
� Decimal => 170 Hex => AA
� Decimal => 171 Hex => AB
� Decimal => 172 Hex => AC
� Decimal => 173 Hex => AD
� Decimal => 174 Hex => AE
� Decimal => 175 Hex => AF
� Decimal => 176 Hex => B0
� Decimal => 177 Hex => B1
� Decimal => 178 Hex => B2
� Decimal => 179 Hex => B3
� Decimal => 180 Hex => B4
� Decimal => 181 Hex => B5
� Decimal => 182 Hex => B6
� Decimal => 183 Hex => B7
� Decimal => 184 Hex => B8
� Decimal => 185 Hex => B9
� Decimal => 186 Hex => BA
� Decimal => 187 Hex => BB
� Decimal => 188 Hex => BC
� Decimal => 189 Hex => BD
� Decimal => 190 Hex => BE
� Decimal => 191 Hex => BF
� Decimal => 192 Hex => C0
� Decimal => 193 Hex => C1
� Decimal => 194 Hex => C2
� Decimal => 195 Hex => C3
� Decimal => 196 Hex => C4
� Decimal => 197 Hex => C5
� Decimal => 198 Hex => C6
� Decimal => 199 Hex => C7
� Decimal => 200 Hex => C8
� Decimal => 201 Hex => C9
� Decimal => 202 Hex => CA
� Decimal => 203 Hex => CB
� Decimal => 204 Hex => CC
� Decimal => 205 Hex => CD
� Decimal => 206 Hex => CE
� Decimal => 207 Hex => CF
� Decimal => 208 Hex => D0
� Decimal => 209 Hex => D1
� Decimal => 210 Hex => D2
� Decimal => 211 Hex => D3
� Decimal => 212 Hex => D4
� Decimal => 213 Hex => D5
� Decimal => 214 Hex => D6
� Decimal => 215 Hex => D7
� Decimal => 216 Hex => D8
� Decimal => 217 Hex => D9
� Decimal => 218 Hex => DA
� Decimal => 219 Hex => DB
� Decimal => 220 Hex => DC
� Decimal => 221 Hex => DD
� Decimal => 222 Hex => DE
� Decimal => 223 Hex => DF
� Decimal => 224 Hex => E0
� Decimal => 225 Hex => E1
� Decimal => 226 Hex => E2
� Decimal => 227 Hex => E3
� Decimal => 228 Hex => E4
� Decimal => 229 Hex => E5
� Decimal => 230 Hex => E6
� Decimal => 231 Hex => E7
� Decimal => 232 Hex => E8
� Decimal => 233 Hex => E9
� Decimal => 234 Hex => EA
� Decimal => 235 Hex => EB
� Decimal => 236 Hex => EC
� Decimal => 237 Hex => ED
� Decimal => 238 Hex => EE
� Decimal => 239 Hex => EF
� Decimal => 240 Hex => F0
� Decimal => 241 Hex => F1
� Decimal => 242 Hex => F2
� Decimal => 243 Hex => F3
� Decimal => 244 Hex => F4
� Decimal => 245 Hex => F5
� Decimal => 246 Hex => F6
� Decimal => 247 Hex => F7
� Decimal => 248 Hex => F8
� Decimal => 249 Hex => F9
� Decimal => 250 Hex => FA
� Decimal => 251 Hex => FB
� Decimal => 252 Hex => FC
� Decimal => 253 Hex => FD
� Decimal => 254 Hex => FE
� Decimal => 255 Hex => FF
 



So ... the font used by VS/VM for Serial Monitor does not have a Degree Symbol Tongue

So ... next question.  Can I change the font VS/VM uses for Serial Monitor and, if so, how do I do that?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How do I print the degree character to Serial Output in VS/VM?
Reply #2 - Feb 25th, 2018 at 1:15pm
Print Post  
Interesting thanks.

Can you confirm which windows font will give proportional spacing and a degree symbol?

I can change for next release
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How do I print the degree character to Serial Output in VS/VM?
Reply #3 - Mar 6th, 2018 at 3:44pm
Print Post  
The latest update 1803.6 resolves this issue.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint