TypeError: can't convert NoneType to int

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
User avatar
Posts: 3367
Joined: Fri Jul 18, 2014 8:01 am
Location: UK

Re: TypeError: can't convert NoneType to int

Post by pythoncoder » Thu Mar 01, 2018 8:34 am

Re the LCD the driver doesn't maintain a cursor position. This is to keep it simple: these displays have only a few characters on each line. They refresh very fast. So a line update requires a string comprising all the text. Your options are either to adapt the driver to maintain a text cursor for each line or to use Python string formatting, e.g.

Code: Select all

lcd[0] = "value:{} {}".format(concentration, "Here I want another string to be displayed")
Regarding your driver, I don't have the hardware device so I can't suggest any reasons why it is returning unexpected values.
Peter Hinch

Posts: 118
Joined: Wed Dec 27, 2017 8:52 am

Re: TypeError: can't convert NoneType to int

Post by nikhiledutech » Thu Mar 01, 2018 10:20 am

Okay sir

Post Reply