This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
uphp:functions:ow_write [2017/05/11 22:40] jeff |
uphp:functions:ow_write [2021/09/13 05:57] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======array_key====== | + | ======ow_write====== |
- | < | + | < |
- | Return | + | Write a byte to the OneWire bus |
====Description==== | ====Description==== | ||
<well size=" | <well size=" | ||
- | <span style=" | + | <span style=" |
- | <span style=" | + | |
- | <span style=" | + | |
- | <span style=" | + | |
<span style=" | <span style=" | ||
- | <span style=" | + | <span style=" |
<span style=" | <span style=" | ||
</ | </ | ||
- | ====Parameters==== | + | This function will write a single byte to the OneWire bus. This is a low level function allowing custom OneWire operations. |
- | < | + | ====Parameter==== |
- | < | + | < |
====Return Values==== | ====Return Values==== | ||
- | < | + | None |
====Example==== | ====Example==== | ||
- | |||
- | ===Create an array with key value pairs, iterate through the array, print out all keys and their associated values=== | ||
<code php> | <code php> | ||
- | <pre><? | + | <? |
- | | + | |
- | | + | |
- | $arr[' | + | |
- | $arr[' | + | ?> |
- | + | ||
- | for ($i=0; $i < sizeof($arr); $i++) { | + | |
- | | + | |
- | print(" | + | |
- | } | + | |
- | ?></ | + | |
- | </ | + | |
- | + | ||
- | The above example will output: | + | |
- | < | + | |
- | Key at Index 0 is name and value is John | + | |
- | Key at Index 1 is age and value is 30 | + | |
- | Key at Index 2 is status and value is 1 | + | |
</ | </ | ||
====See Also==== | ====See Also==== | ||
- | [[array()]] - Create an < | + | [[ow_first()]] - Initiate a OneWire bus scan and return the address of the first device found |
- | [[array_keys()]] - Return | + | [[ow_next()]] - Return |
- | [[sizeof()]] - Return | + | [[ow_read_temp()]] - Read a temperature from a device on the OneWire bus |
- | [[print_r()]] - Dump the contents of an < | + | [[ow_reset()]] - Reset the OneWire bus |
- | [[uphp: | + | [[ow_read()]] - Read a byte from the OneWire bus |