This shows you the differences between two versions of the page.
Next revision Both sides next revision | |||
uphp:functions:ow_write [2017/05/11 10:07] admin created |
uphp:functions:ow_write [2017/05/11 22:40] jeff |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======ow_write====== | + | ======array_key====== |
- | < | + | < |
- | Write a byte to the Onewire bus. This is a low level function allowing custom onewire operations. | + | Return |
====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=" | ||
</ | </ | ||
- | ====Parameter==== | + | ====Parameters==== |
- | An < | + | < |
+ | |||
+ | < | ||
====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> | ||
< | < | ||
- | + | $arr=array(); | |
- | ow_write(10); | + | $arr[' |
- | ow_write(11); | + | |
- | ow_write(0x55); | + | $arr[' |
- | + | ||
- | ?> | + | for ($i=0; $i < sizeof($arr); $i++) { |
+ | | ||
+ | print("Key at Index " | ||
+ | | ||
+ | ?></ | ||
</ | </ | ||
+ | |||
+ | 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==== | ||
- | [[ow_first()]] - Get the first device on the bus | + | [[array()]] - Create an < |
- | [[ow_next()]] - Get next device on bus | + | [[array_keys()]] - Return keys for an < |
- | [[ow_read_temp()]] - Read a temperature from a device | + | [[sizeof()]] - Return the number of elements in an < |
- | [[ow_reset()]] - Reset the onewire bus | + | [[print_r()]] - Dump the contents of an < |
- | [[ow_read()]] - Read a byte from the onewire bus | + | [[uphp: |