User Tools

Site Tools


uphp:functions:ow_first

Differences

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

Link to this comparison view

uphp:functions:ow_first [2017/05/11 23:30]
jeff
uphp:functions:ow_first [2021/09/13 05:57]
Line 1: Line 1:
-======ow_first====== 
- 
-<badge>WMPRO >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> 
- 
-Initiate a OneWire bus scan and return the address of the first device found 
- 
-====Description==== 
- 
-<well size="sm"><html> 
-<span style="font-size:125%;color:green">mixed 
-<span style="color:black">ow_first ( ) 
-</html></well> 
- 
-This function starts a new OneWire bus scan and provides the address of the first device found.  Currently only DS18B20 temperature sensors are detectable. 
- 
-====Parameters==== 
- 
-None 
- 
-====Return Values==== 
- 
-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 devices were detected.</html> 
- 
-====Example==== 
- 
-<code php> 
-<? 
-  $arr=ow_first(); 
-  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]); 
-    print("Detected the first OneWire device ".$devname); 
-  } else { 
-    print("No devices detected."); 
-  } 
-?> 
-</code> 
- 
-====See Also==== 
- 
-[[ow_next()]] - Return the address of the next OneWire device found (after an ow_first) 
- 
-[[ow_read()]] - Read a byte from the OneWire bus 
- 
-[[ow_read_temp()]] - Read a temperature from a device on the OneWire bus 
- 
-[[ow_reset()]] - Reset the OneWire bus 
- 
-[[ow_write()]] - Write a byte to the OneWire bus 
  
uphp/functions/ow_first.txt · Last modified: 2021/09/13 05:57 (external edit)