Support for this Lua module has been discontinued.
Equivalent functionality is available from the bmp085 module in the NodeMCU
firmware code base. Refer to `docs/en/modules/bmp085.md` for API
documentation.
The original Lua code can be found in the [git repository](https://github.com/nodemcu/nodemcu-firmware/tree/2fbd5ed509964a16057b22e00aa8469d6a522d73/lua_modules/bmp085).
oss: Over sampling setting, which is 0,1,2,3. Default value is 0.<br/>
####Returns
p: Integer, calibrated data of pressure from bmp085.
####Example
```lua
bmp085=require("bmp085")
sda=1
scl=2
bmp085.init(sda,scl)
p=bmp085.getUP(oss)
print(p)
-- Don't forget to release it after use
bmp085=nil
package.loaded["bmp085"]=nil
```
####See also
**-**[]()
<aid="bmp085_getUP_raw"></a>
##getUP_raw()
####Description
Get raw data of pressure from bmp085.<br/>
####Syntax
getUP_raw(oss)
####Parameters
oss: Over sampling setting, which is 0,1,2,3. Default value is 0.<br/>
####Returns
up_raw: Integer, raw data of pressure from bmp085.
####Example
```lua
bmp085=require("bmp085")
sda=1
scl=2
bmp085.init(sda,scl)
up=bmp085.getUP_raw(oss)
print(up)
-- Don't forget to release it after use
bmp085=nil
package.loaded["bmp085"]=nil
```
####See also
**-**[]()
<aid="bmp085_getUT"></a>
##getUT()
####Description
Get temperature from bmp085.<br/>
####Syntax
getUT(num_10x)
####Parameters
num_10x: num_10x: bool value, if true, return number of 0.1 centi-degree. Default value is false, which return a string , eg: 16.7.<br/>
####Returns
t: Integer or String, if num_10x is true, return number of 0.1 centi-degree, otherwise return a string.The temperature from bmp085.<br/>
####Example
```lua
bmp085=require("bmp085")
sda=1
scl=2
bmp085.init(sda,scl)
-- Get string of temperature.
p=bmp085.getUT(false)
print(p)
-- Get number of temperature.
p=bmp085.getUT(true)
print(p)
-- Don't forget to release it after use
bmp085=nil
package.loaded["bmp085"]=nil
```
####See also
**-**[]()
<aid="bmp085_getAL"></a>
##getAL()
####Description
Get estimated data of altitude from bmp085.<br/>
####Syntax
getAL(oss)
####Parameters
oss: over sampling setting, which is 0,1,2,3. Default value is 0.<br/>
####Returns
e: Integer, estimated data of altitude. Altitudi can be calculated by pressure refer to sea level pressure, which is 101325. Pressure changes 100pa corresponds to 8.43m at sea level<br/>
Support for this Lua module has been discontinued.
This module is compatible with DHT11, DHT21 and DHT22.
Equivalent functionality is available from the dht module in the NodeMCU
And is able to auto-select wheather you are using DHT11 or DHT2x
firmware code base. Refer to `docs/en/modules/dht.md` for API
documentation.
No need to use a resistor to connect the pin data of DHT22 to ESP8266.
The original Lua code can be found in the [git repository](https://github.com/nodemcu/nodemcu-firmware/tree/2fbd5ed509964a16057b22e00aa8469d6a522d73/lua_modules/dht_lib).
##Integer Verison[When using DHT11, Float version is useless...]
-- Setting PIN1 to triggers on interrupt when alarm triggers
gpio.mode(1,gpio.INT)
gpio.trig(1,'down',function(level)
print('Time is passing')
-- If not reloaded it will be triggered only once
ds3231.reloadAlarms()
end)
ds3231.setAlarm(2,ds3231.EVERYMINUTE)
-- Don't forget to release it after use
ds3231=nil
package.loaded["ds3231"]=nil
```
####See also
**-**[]()
<aid="ds3231_reloadAlarms"></a>
## reloadAlarms()
####Description
Reload an already triggered alarm. Otherwise it will never be triggered again.
There are two different alarms and they have to be reloaded both to let, even only one, to be triggered again. So there isn't a param to select which alarm to reload.
####Syntax
reloadAlarms()
####Parameters
nil
####Returns
nil
####Example
```lua
ds3231=require("ds3231")
ds3231.init(3,4)
-- Setting PIN1 to triggers on interrupt when alarm triggers
gpio.mode(1,gpio.INT)
gpio.trig(1,'down',function(level)
print('Time is passing')
-- If not reloaded it will be triggered only once
ds3231.reloadAlarms()
end)
ds3231.setAlarm(2,ds3231.EVERYMINUTE)
-- Don't forget to release it after use
ds3231=nil
package.loaded["ds3231"]=nil
```
####See also
**-**[]()
<aid="ds3231_enableAlarm"></a>
## enableAlarm()
####Description
Enable an already setted alarm with the previous matching conditions. It reloads alarms internally.
####Syntax
enableAlarm(alarmId)
####Parameters
alarmId: 1-2
####Returns
nil
####Example
```lua
ds3231=require("ds3231")
ds3231.init(3,4)
-- Trigger on x:20:15
ds3231.setAlarm(1,ds3231.MINUTE,15,20)
ifbadThing==1then
ds3231.disableAlarm(1)
end
ifgoodThing==1then
ds3231.enableAlarm(1)
end
-- Don't forget to release it after use
ds3231=nil
package.loaded["ds3231"]=nil
```
####See also
**-**[]()
<aid="ds3231_disableAlarm"></a>
## disableAlarm()
####Description
Disable an already setted alarm with the previous matching conditions.
if _alarmId_ is not 1 or 2 it disables both alarms.
**Warning**: `disableAlarm()` prevent alarms to trigger interrupt over SQW pin but alarm itself will triggers at the matching conditions as it could be seen on _status byte_.
####Syntax
disableAlarm(alarmId)
####Parameters
alarmId: 0-2
####Returns
nil
####Example
```lua
ds3231=require("ds3231")
ds3231.init(3,4)
-- Trigger on x:20:15
ds3231.setAlarm(1,ds3231.MINUTE,15,20)
ifbadThing==1then
ds3231.disableAlarm(1)
end
ifgoodThing==1then
ds3231.enableAlarm(1)
end
-- Don't forget to release it after use
ds3231=nil
package.loaded["ds3231"]=nil
```
####See also
**-**[]()
<aid="ds3231_getBytes"></a>
## getBytes()
####Description
Get bytes of control, for debug purpose, and status of DS3231. To see what they means check the [Datasheet](http://datasheets.maximintegrated.com/en/ds/DS3231.pdf)
####Syntax
getBytes()
####Parameters
nil
####Returns
control: integer. Control 0-255
status: integer. Status 0-143 (bit 6-5-4 unused)
####Example
```lua
ds3231=require("ds3231")
ds3231.init(3,4)
control,status=ds3231.getBytes()
print('Control byte: '..control)
print('Status byte: '..status)
-- Don't forget to release it after use
ds3231=nil
package.loaded["ds3231"]=nil
```
####See also
**-**[]()
<aid="ds3231_resetStopFlag"></a>
## resetStopFlag()
####Description
Stop flag on status byte means that the oscillator either is stopped or was stopped for some period and may be used to judge the validity of the timekeeping data.
When setted to 1 this flag keeps that values until changed to 0.
Call `resetStopFlag()` if you need to check validity of time data after that.
This module adds basic support for the LM92 +-0.33C 12bit+sign temperature sensor. More details in the [datasheet](http://www.ti.com/lit/ds/symlink/lm92.pdf).
This module adds basic support for the LM92 +-0.33C 12bit+sign temperature sensor. More details in the [datasheet](http://www.ti.com/lit/ds/symlink/lm92.pdf).
Support for this Lua module has been discontinued.
Equivalent functionality is available from the dht module in the NodeMCU
firmware code base. Refer to `docs/en/modules/tsl2561.md` for API
documentation.
The original Lua code can be found in the [git repository](https://github.com/nodemcu/nodemcu-firmware/tree/2fbd5ed509964a16057b22e00aa8469d6a522d73/lua_modules/tsl2561).