Page 1 of 1

How to get the Degree Sign (chr176) in Micropython?

Posted: Thu Jun 07, 2018 3:24 pm
by holger
Hello Folks,
i stuck in display the ° Sign in Micropython on an ESP8266. Python 3.5 converted by typing "print(chr(176))" the degree sign well. But with micropython 1.9.4 and the fork from loboris for the ESP32 i got the message: "recv unexpected word."

Any solutions?

Kind regards,

Holger

Re: How to get the Degree Sign (chr176) in Micropython?

Posted: Sat Jun 09, 2018 9:02 am
by pythoncoder
This works on standard MicroPython (tested on Unix build and on Pyboard). So it looks like an issue specific to the Loboris port. I suggest you raise it either on GitHub or on the Loboris forum.

Code: Select all

MicroPython v1.9.4-131-gb789c64 on 2018-06-07; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> print(chr(176))
°
>>> 

Re: How to get the Degree Sign (chr176) in Micropython?

Posted: Sat Jun 09, 2018 9:02 pm
by loboris
holger wrote:
Thu Jun 07, 2018 3:24 pm
Hello Folks,
i stuck in display the ° Sign in Micropython on an ESP8266. Python 3.5 converted by typing "print(chr(176))" the degree sign well. But with micropython 1.9.4 and the fork from loboris for the ESP32 i got the message: "recv unexpected word."
It works without issues:

Code: Select all

MicroPython ESP32_LoBo_v3.2.18 - 2018-06-04 on ESP32 board with ESP32
Type "help()" for more information.
>>> print(chr(176))
°
>>> 
The displayed character may depend on terminal emulator used.
How are you connected to the board?

Re: How to get the Degree Sign (chr176) in Micropython?

Posted: Sun Jun 10, 2018 9:59 am
by holger
You are right. Its a Problem with my terminal. I use uPycraft and on print(chr(176)) i got the reply "recv unexpected word." With putty "print(chr(176)) works well.