Deprecate C ds18b20 module (#2581)

This commit is contained in:
Nathaniel Wesley Filardo 2018-12-05 20:38:11 +00:00 committed by Arnim Läuger
parent 47a6ed01b5
commit 61433c448e
3 changed files with 12 additions and 2 deletions

View File

@ -67,6 +67,9 @@ static int ds18b20_lua_readoutdone(void);
// Setup onewire bus for DS18B20 temperature sensors // Setup onewire bus for DS18B20 temperature sensors
// Lua: ds18b20.setup(OW_BUS_PIN) // Lua: ds18b20.setup(OW_BUS_PIN)
static int ds18b20_lua_setup(lua_State *L) { static int ds18b20_lua_setup(lua_State *L) {
platform_print_deprecation_note("ds18b20 C module superseded by Lua implementation", "soon");
// check ow bus pin value // check ow bus pin value
if (!lua_isnumber(L, 1) || lua_isnumber(L, 1) == 0) { if (!lua_isnumber(L, 1) || lua_isnumber(L, 1) == 0) {
return luaL_error(L, "wrong 1-wire pin"); return luaL_error(L, "wrong 1-wire pin");

View File

@ -3,7 +3,14 @@
| :----- | :-------------------- | :---------- | :------ | | :----- | :-------------------- | :---------- | :------ |
| 2017-06-11 | [fetchbot](https://github.com/fetchbot) | [fetchbot](https://github.com/fetchbot) | [ds18b20.c](../../../app/modules/ds18b20.c)| | 2017-06-11 | [fetchbot](https://github.com/fetchbot) | [fetchbot](https://github.com/fetchbot) | [ds18b20.c](../../../app/modules/ds18b20.c)|
This module provides access to the DS18B20 1-Wire digital thermometer. Note that NodeMCU offers both a C module (this one) and [a Lua module for this sensor](https://github.com/nodemcu/nodemcu-firmware/tree/dev/lua_modules/ds18b20). See [#2003](https://github.com/nodemcu/nodemcu-firmware/pull/2003) for a discussion on the respective merits of them. This module provides access to the DS18B20 1-Wire digital thermometer.
## Deprecation Notice
Note that NodeMCU offers both a C module (this one) and [a Lua module for this
sensor](https://github.com/nodemcu/nodemcu-firmware/tree/dev/lua_modules/ds18b20).
The C implementation is deprecated and will be removed soon; please transition
to Lua code.
## ds18b20.read() ## ds18b20.read()
Issues a temperature conversion of all connected sensors on the onewire bus and returns the measurment results after a conversion delay in a callback function. Issues a temperature conversion of all connected sensors on the onewire bus and returns the measurment results after a conversion delay in a callback function.

View File

@ -1,6 +1,6 @@
# DS18B20 Module # DS18B20 Module
This is a Lua module for the DS18B20 1-Wire digital thermometer. Note that NodeMCU offers both a Lua module (this one) and [a C module for this sensor](http://nodemcu.readthedocs.io/en/latest/en/modules/ds18b20/). See [#2003](https://github.com/nodemcu/nodemcu-firmware/pull/2003) for a discussion on the respective merits of them. This is a Lua module for the DS18B20 1-Wire digital thermometer.
## Require ## Require
```lua ```lua