![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvXRBlsktorK75PILwPiS6Fqkh1VHWIztLuMpavJarz2qyEV9ewzu0Op73zJs5cpJzlcTWRYD7XfhaForgi2loMhCmC5cVUcSFICc4mx7N8vk11x_3-sJVV4GyZseVek0qxrZUDt5IRzoQ/s320/201607_ESP8266_KY019_temperature.jpeg)
Testing the ESP8266 with 18B20 temperature sensor
( KY-001 from 37in1Sensor kit )
Hardware connection
- Pin S Signal - GPIO2 ( onewire )
- Pin middel VCC +3V3
- Pin - Ground
ESP8266Basic (version 3)
TEMP({DEVICE ID}):
Will retrieve temperature sensor reading from certain 1 wire devices connected to pin 2.
Bla = temp({Device ID})
i found :
temp( 0 ) First temperature device
temp( 1 ) Second temperature device
' TestKY019.bas - 2016 V0.1
timer 3000 , [NewVal]
wait
[NewVal]
cls
msg$ = "<head><meta http-equiv='refresh' content='3'></head><H1>Temperature sensor </H1>" & time() & " Temperature = " & temp( 0 )
wprint htmlvar( msg$ )
returngui
wait
end
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAqAEtbUhLPwVxRZ5urLQBpzNgtBDdtbXWjjVqBXe4VUwBmJkUcqFPaW46hjCT92PWJ4LOBQ7NitKYsfqkp-SVhVs3d7PoVKFGHXYHNks_tD7IZsH49rOTrG-MtKDLrncktBTTB5HcqXwL/s200/JJ_KY001_0.jpg)
Will retrieve temperature sensor reading from certain 1 wire devices connected to pin 2.
Bla = temp({Device ID})
ESP8266 Forum info
In article on http://www.esp8266.com/viewtopic.php?f=40&t=10402&p=49157&hilit=temperature#p49157i found :
temp( 0 ) First temperature device
temp( 1 ) Second temperature device
ESP8266Basic program
for (first) 18B20' TestKY019.bas - 2016 V0.1
timer 3000 , [NewVal]
wait
[NewVal]
cls
msg$ = "<head><meta http-equiv='refresh' content='3'></head><H1>Temperature sensor </H1>" & time() & " Temperature = " & temp( 0 )
wprint htmlvar( msg$ )
returngui
wait
end
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAqAEtbUhLPwVxRZ5urLQBpzNgtBDdtbXWjjVqBXe4VUwBmJkUcqFPaW46hjCT92PWJ4LOBQ7NitKYsfqkp-SVhVs3d7PoVKFGHXYHNks_tD7IZsH49rOTrG-MtKDLrncktBTTB5HcqXwL/s200/JJ_KY001_0.jpg)
No comments:
Post a Comment