You’ve already done the hard part! (The display). Apart from moving any setup code from the display example you’re using you could use something like this:
from tmp117 import *
from utime import sleep_ms
mySensor = tmp117()
while True:
# Read and print the temperature in various units
tempC = mySensor.readTempC() # Celsius
tempF = mySensor.readTempF() # Farenheit
tempK = mySensor.readTempK() # Kelvin
tempStringC = str(tempC) # convert temperature number to string
lcd.clear()
lcd.move_to(1,1)
lcd.putstr("It's " + tempStringC + "°C")
sleep_ms(1000)
Once you’ve added your lcd setup stuff to the beginning of that, it should just work!
Keen to see if it works or we need to do some troubleshooting
James
Try getting rid of the degrees (°) symbol and the apostrophe (’) symbol. Also, take the LCD out of the mix and see if it’s writing data back correctly via a REPL.
The library only supports Ascii characters 32-127 (basically upper and lowercase letters, plus a few other common characters). http://www.asciitable.com/
It might be some ungraceful handling of unknown characters by that LCD library.
1 Like
And you can get our latest projects and tips straight away by following us on: