User Tools

Site Tools


uphp:functions:ow_next

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:ow_next [2017/05/11 10:02]
admin
uphp:functions:ow_next [2021/09/13 05:57] (current)
Line 1: Line 1:
 ======ow_next====== ======ow_next======
  
-<badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge>+<badge>WMPRO >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge>
  
-Read the next device from a onewire bus.+Return the address of the next OneWire device found (after an ow_first)
  
 ====Description==== ====Description====
  
 <well size="sm"><html> <well size="sm"><html>
-<span style="font-size:125%;color:green">array +<span style="font-size:125%;color:green">mixed 
-<span style="color:black">ow_next ( +<span style="color:black">ow_next ( )
-<span style="color:black">)+
 </html></well> </html></well>
  
-====Parameter====+This function continues a OneWire bus scan and provides the address of the next device found.  Currently only DS18B20 temperature sensors are detectable.
  
-none+====Parameters==== 
 + 
 +None
  
 ====Return Values==== ====Return Values====
  
-An <html><b><span style="color:green">array<span style="color:black"></b></html> of 8 elements containing the unique onewire address.  Returns 0 if no more devices were detected+An <html><b><span style="color:green">array<span style="color:black"></b> of 8 elements containing the unique OneWire address.  Returns <b><span style="color:green">int<span style="color:black"></b> 0 if no more devices were detected.</html>
  
 ====Example==== ====Example====
  
 <code php> <code php>
-<pre><?+<?
   $arr=ow_first();   $arr=ow_first();
   if ($arr) {  // first device was detected, let's get the second device now   if ($arr) {  // first device was detected, let's get the second device now
     $arr=ow_next();     $arr=ow_next();
-    if ($arr) { +    if ($arr) {
       $devname=sprintf("%02X%02X%02X%02X%02X%02X%02X%02X",$arr[0],$arr[1],$arr[2],$arr[3],$arr[4],$arr[5],$arr[6],$arr[7]);       $devname=sprintf("%02X%02X%02X%02X%02X%02X%02X%02X",$arr[0],$arr[1],$arr[2],$arr[3],$arr[4],$arr[5],$arr[6],$arr[7]);
-      print("Detected second Onewire device ".$devname);+      print("Detected second OneWire device ".$devname);
     }     }
-  } else print("No devices detected.");+  } else 
 +    print("No devices detected."); 
 +  }
 ?> ?>
 </code> </code>
 +
 ====See Also==== ====See Also====
  
-[[ow_first()]] - Get the first device on the bus+[[ow_first()]] - Initiate a OneWire bus scan and return the address of the first device found 
 + 
 +[[ow_read()]] - Read a byte from the OneWire bus
  
-[[ow_read()]] - Read from onewire bus+[[ow_read_temp()]] - Read a temperature from a device on the OneWire bus
  
-[[ow_read_temp()]] - Read a temperature from a device+[[ow_reset()]] - Reset the OneWire bus
  
-[[ow_reset()]] - Reset the onewire bus+[[ow_write()]] - Write a byte to the OneWire bus
  
-[[ow_write()]] - Write to onewire bus+[[sprintf()]] - Return a formatted <html><b><span style="color:green">string</b></html>
  
uphp/functions/ow_next.1494496933.txt.gz · Last modified: 2021/09/13 05:56 (external edit)