@@ -60,14 +60,14 @@ Stops forcing power onto the bus. You only need to do this if you used the 'powe
...
@@ -60,14 +60,14 @@ Stops forcing power onto the bus. You only need to do this if you used the 'powe
#### Returns
#### Returns
`nil`
`nil`
####See also
####See also
-[ow.write()](#owwrite)
-[ow.write()](#owwrite)
-[ow.write_bytes()](#owwrite_bytes)
-[ow.write_bytes()](#owwrite_bytes)
## ow.read()
## ow.read()
Reads a byte.
Reads a byte.
####Syntax
####Syntax
`ow.read(pin)`
`ow.read(pin)`
#### Parameters
#### Parameters
...
@@ -118,10 +118,11 @@ Clears the search state so that it will start from the beginning again.
...
@@ -118,10 +118,11 @@ Clears the search state so that it will start from the beginning again.
Looks for the next device.
Looks for the next device.
#### Syntax
#### Syntax
`ow.search(pin)`
`ow.search(pin, [alarm_search])`
#### Parameters
#### Parameters
`pin` 1~12, I/O index
-`pin` 1~12, I/O index
-`alarm_search` 1 / 0, if 0 a regular 0xF0 search is performed (default if parameter is absent), if 1 a 0xEC ALARM SEARCH is performed.
#### Returns
#### Returns
`rom_code` string with length of 8 upon success. It contains the rom code of slave device. Returns `nil` if search was unsuccessful.
`rom_code` string with length of 8 upon success. It contains the rom code of slave device. Returns `nil` if search was unsuccessful.
...
@@ -190,7 +191,7 @@ else
...
@@ -190,7 +191,7 @@ else
end
end
```
```
####See also
####See also
[ow.reset()](#owreset)
[ow.reset()](#owreset)
## ow.setup()
## ow.setup()
...
@@ -230,7 +231,7 @@ Sets up the search to find the device type `family_code`. The search itself has
...
@@ -230,7 +231,7 @@ Sets up the search to find the device type `family_code`. The search itself has
#### Returns
#### Returns
`nil`
`nil`
####See also
####See also
[ow.search()](#owsearch)
[ow.search()](#owsearch)
## ow.write()
## ow.write()
...
@@ -247,7 +248,7 @@ Writes a byte. If `power` is 1 then the wire is held high at the end for parasit
...
@@ -247,7 +248,7 @@ Writes a byte. If `power` is 1 then the wire is held high at the end for parasit
#### Returns
#### Returns
`nil`
`nil`
####See also
####See also
[ow.depower()](#owdepower)
[ow.depower()](#owdepower)
## ow.write_bytes()
## ow.write_bytes()
...
@@ -264,5 +265,48 @@ Writes multi bytes. If `power` is 1 then the wire is held high at the end for pa
...
@@ -264,5 +265,48 @@ Writes multi bytes. If `power` is 1 then the wire is held high at the end for pa
#### Returns
#### Returns
`nil`
`nil`
####See also
####See also
[ow.depower()](#owdepower)
[ow.depower()](#owdepower)
## ow.set_timings()
Tweak different bit timing parameters. Some slow custom devices might not work perfectly well with NodeMCU as 1-wire master. Since NodeMCU ow module is bit-banging the 1-wire protocol, it is possible to adjust the timings a bit.
Note that you can break the protocol totally if you tweak some numbers too much. This should never be needed with normal devices.