Mmiscool wrote:At the top of your code set Temp = 0
When you create the text box with a variable that is not initialised it creates the variable as a string by default and not a number.
Thanks for your help
took out the textbox, set Temp and Hum = 0
now just shows 0 for both values.
Don't spend too much time on this. thanks AL
memclear
cls
oled.cls()
Temp = 0
Hum = 0
PinDHT = 2
DHT.SETUP(11, PinDHT)
i2c.setup(4,5)
timer 1000, [branch] ' ## Time for auto refresh variables ##
oled.print("Current Temperature", 10,1)
oled.print(str(Temp), 10,10)
oled.print("Current Humidity", 10,18)
oled.print(str(Hum), 10,28) '** Hum not showing on OLED
oled.print("Your IP is:", 10,36)
oled.print(ip(), 30,48)
Wait
[TestExit]
timer 0
end
[branch]
gosub [readdata]
wait
[readdata]
Temp = DHT.TEMP() 'Current Temperature
Hum = DHT.HUM() 'Current Humidity