This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
uphp:functions:ow_first [2017/05/11 09:58] admin |
uphp:functions:ow_first [2021/09/13 05:57] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
======ow_first====== | ======ow_first====== | ||
- | < | + | < |
- | Start a new OneWire bus scan and return the first device. Currently only DS18B20 temperature sensors are detectable. | + | Initiate |
====Description==== | ====Description==== | ||
<well size=" | <well size=" | ||
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | |
</ | </ | ||
- | ====Parameter==== | + | This function starts a new OneWire bus scan and provides the address of the first device found. |
- | none | + | ====Parameters==== |
+ | |||
+ | None | ||
====Return Values==== | ====Return Values==== | ||
- | An < | + | An < |
====Example==== | ====Example==== | ||
<code php> | <code php> | ||
- | <pre><? | + | <? |
$arr=ow_first(); | $arr=ow_first(); | ||
if ($arr) { | if ($arr) { | ||
- | $devname=sprintf(" | + | $devname=sprintf(" |
- | print(" | + | print(" |
- | } else print(" | + | } else { |
+ | | ||
+ | } | ||
?> | ?> | ||
</ | </ | ||
+ | |||
====See Also==== | ====See Also==== | ||
- | [[ow_next()]] - Get next onewire | + | [[ow_next()]] - Return the address of the next OneWire |
- | [[ow_read()]] - Read from onewire | + | [[ow_read()]] - Read a byte from the OneWire |
- | [[ow_read_temp()]] - Read a temperature from a device | + | [[ow_read_temp()]] - Read a temperature from a device |
- | [[ow_reset()]] - Reset the onewire | + | [[ow_reset()]] - Reset the OneWire |
- | [[ow_write()]] - Write to onewire | + | [[ow_write()]] - Write a byte to the OneWire |
- | </ | + | [[sprintf()]] - Return a formatted < |