General area when it fits no where else

Moderator: Mmiscool

User avatar
By bugs
#46466 Hello
Using ESP-11 and BASIC ver 2.0.18.
DHT11 connected to GPIO2.
This program crashes at the dht.setup line.
Any clues/suggestions please?
Code: Select allmemclear
cls

' *************************crashes if next line present:-
dht.setup(11,2)

button "Temperature" [gettemp]
button "Exit " [Exit]

wprint "<br>"
wprint "<br>"
wprint "CurrTemp="
curr=0
wprint htmlvar(curr)
wait

[gettemp]
 curr=dht.temp
wait
 
[Exit]
wprint "<br>"
wprint "<br>"
wprint "<a href='/'>Menu</a>"
end


The serial output has this:-

Exception (28):
epc1=0x40223f3e epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont
sp: 3fff2340 end: 3fff2ac0 offset: 01a0

>>>stack>>>
3fff24e0: 40106fa0 00000002 3fff2510 4022418c
3fff24f0: 3fff6148 3fff25b0 0000000b 40223f6c
3fff2500: 00000000 3fff25b0 00000002 4020e4b4
3fff2510: 00000000 00000000 00000000 3fff5ee8
3fff2520: 0000000f 00000006 402194ec 3fff1aa0
etc etc
User avatar
By cicciocb
#46483 You should use latest version (20) as the ver 18 has a bug on the pins.
With the version 18 you should type dht.setup(11,"2")
User avatar
By bugs
#46495 Thank you for such a speedy response!
I have downloaded version 20 and the program now progresses.
The web page now says:-
CurrTemp=dht.temp
I added a serialprint of the variable and it also says "dht.temp" as does the variable dump.

I do not think there is any activity on the GPIO2 pin. The oscilloscope shows it remains high throughout the program run.
The GPIO2 pin does work if I attach an LED andrun a program to blink it.

I would really appreciate any guidance to troubleshoot.
User avatar
By Mmiscool
#46529 dht.temp() is a function and needs the parenthesizes at the end.
Code: Select allcurr = dht.temp()