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

Next revision
Previous revision
Next revision Both sides next revision
uphp:functions:ow_first [2017/05/11 09:58]
admin created
uphp:functions:ow_first [2017/05/11 09:59]
admin
Line 3: Line 3:
 <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge>
  
-Start a new OneWire bus scan and return the first device+Start a new OneWire bus scan and return the first device.  Currently only DS18B20 temperature sensors are detectable.
  
 ====Description==== ====Description====
Line 27: Line 27:
   $arr=ow_first();   $arr=ow_first();
   if ($arr) {   if ($arr) {
-    $devname=sprintf("%02X%02X%02X%02X%02X%02X%02X%02X",$dev[$i][0],$dev[$i][1],$dev[$i][2],$dev[$i][3],$dev[$i][4],$dev[$i][5],$dev[$i][6],$dev[$i][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 Onewire device ".$devname);     print("Detected Onewire device ".$devname);
   } else print("No devices detected.");   } else print("No devices detected.");
Line 34: Line 34:
 ====See Also==== ====See Also====
  
-[[ow_next()]] - Get next Onewire device+[[ow_next()]] - Get next onewire device 
 [[ow_read()]] - Read from onewire bus [[ow_read()]] - Read from onewire bus
 +
 [[ow_read_temp()]] - Read a temperature from a device [[ow_read_temp()]] - Read a temperature from a device
 +
 [[ow_reset()]] - Reset the onewire bus [[ow_reset()]] - Reset the onewire bus
-[[ow_write()]] - Write to onewire bus 
  
-</html>+[[ow_write()]] - Write to onewire bus
  
uphp/functions/ow_first.txt · Last modified: 2021/09/13 05:57 (external edit)