User Tools

Site Tools


uphp:functions:ow_read_temp

Differences

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

Link to this comparison view

Next revision
Previous revision
uphp:functions:ow_read_temp [2017/05/11 10:19]
admin created
uphp:functions:ow_read_temp [2021/09/13 05:57] (current)
Line 1: Line 1:
 ======ow_read_temp====== ======ow_read_temp======
  
-<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 a temperature from a device on the onewire bus+Read a temperature from a device on the OneWire bus
  
 ====Description==== ====Description====
Line 9: Line 9:
 <well size="sm"><html> <well size="sm"><html>
 <span style="font-size:125%;color:green">float <span style="font-size:125%;color:green">float
-<span style="color:black">ow_read_temp (+<span style="color:black">ow_read_temp ( [
 <span style="color:green">array <span style="color:green">array
 <span style="color:blue">$device_id <span style="color:blue">$device_id
- +<span style="color:black">)
-<span style="color:black">)+
 </html></well> </html></well>
  
 ====Parameter==== ====Parameter====
  
-<html><b><span style="color:blue">$device_id<span style="color:black"></b></html>:  Array of 8 integers containing the unique onewire device id.  This is optional and it will otherwise send a wildcard to read the first device that response, which would work if only one temperature sensor was present.+<html><b><span style="color:blue">$device_id<span style="color:black"></b>:  An <b><span style="color:green">array<span style="color:black"></b> of 8 elements containing the unique OneWire address (optional).  If not specified the function will send a wildcard to read the first device that responds, which will work if only one temperature sensor is present.</html>
  
 ====Return Values==== ====Return Values====
  
-A <html><b><span style="color:green">float<span style="color:black"></b></html> value containing the temperature read from the sensor+A <html><b><span style="color:green">float<span style="color:black"></b></html> value containing the temperature in degrees Celsius
  
-====Example====+====Examples====
  
 <code php> <code php>
-<pre><? +<? 
- +  
   $res=ow_read_temp();   $res=ow_read_temp();
-  print("Temperature is ".$res);+  print("Temperature for the first sensor is ".$res);
      
-  $dev=array(0xA0,0x00,0x00,0x04,0x80,0x57,0x77);+  $dev=array(0xA0,0x00,0x00,0x04,0x80,0x57,0x77,0x35);
   $res=ow_read_temp($dev);   $res=ow_read_temp($dev);
-  print("Temperature for device is ".$res);+  print("Temperature for the specified device is ".$res);
      
 ?> ?>
Line 40: Line 39:
 ====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_next()]] - Get next device on bus+[[ow_next()]] - Return the address of the next OneWire device found (after an ow_first)
  
-[[ow_read()]] - Read a byte from a device+[[ow_read()]] - Read a byte from the OneWire bus
  
-[[ow_reset()]] - Reset the onewire bus+[[ow_reset()]] - Reset the OneWire bus
  
-[[ow_write()]] - Write to onewire bus+[[ow_write()]] - Write a byte to the OneWire bus
  
uphp/functions/ow_read_temp.1494497956.txt.gz · Last modified: 2021/09/13 05:56 (external edit)