User Tools

Site Tools


uphp:functions:ow_read_temp

This is an old revision of the document!


ow_read_temp

WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0

Read a temperature from a device on the onewire bus

Description

float ow_read_temp ( array $device_id )

Parameter

$device_id: 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.

Return Values

A float value containing the temperature read from the sensor

Example

<pre><?
 
  $res=ow_read_temp();
  print("Temperature is ".$res);
 
  $dev=array(0xA0,0x00,0x00,0x04,0x80,0x57,0x77,0x35);
  $res=ow_read_temp($dev);
  print("Temperature for device is ".$res);
 
?>

See Also

ow_first() - Get the first device on the bus

ow_next() - Get next device on bus

ow_read() - Read a byte from a device

ow_reset() - Reset the onewire bus

ow_write() - Write to onewire bus

uphp/functions/ow_read_temp.1494497982.txt.gz · Last modified: 2021/09/13 05:56 (external edit)