-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction_data_sensor.php
More file actions
47 lines (44 loc) · 1.55 KB
/
Copy pathfunction_data_sensor.php
File metadata and controls
47 lines (44 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
function temperature1(){
//echo exec("/www/cgi-bin/sensor1");
$temperature = shell_exec("python python/sensor1.py");
//$millivolt = ($mentah_suhu/4096.0) * 1800;
//$temperature = ($millivolt / 10.0);
echo number_format($temperature,1);
//echo $mentah_suhu;*/z
//echo "145.0";
}
function temperature2(){
//echo exec("/www/cgi-bin/sensor2");
//$mentah_suhu2 = shell_exec("cat /sys/bus/iio/devices/iio:device0/in_voltage3_raw");
$temperature = shell_exec("python python/sensor2.py");
//$milivolt2 = ($mentah_suhu2/4096.0) * 1800;
//$temperature2 = ($milivolt2 / 10.0);
echo number_format($temperature,1);
//echo $mentah_suhu2;*/
//echo "120.0";
}
function fahrenheit1(){
//echo exec("/www/cgi-bin/sensor1");
//$mentah_suhu = shell_exec("cat /sys/bus/iio/devices/iio:device0/in_voltage1_raw");
$temperature = shell_exec("python python/sensor1_fahrenheit.py");
//$millivolt = ($mentah_suhu/4096.0) * 1800;
//$temperature = ($millivolt / 10.0);
//$fahrenheit = ($temperature * 9/5)+32;
echo number_format($temperature,1);
//echo number_format($temperature,1);
//echo $mentah_suhu;*/z
//echo 45.0;
}
function fahrenheit2(){
//echo exec("/www/cgi-bin/sensor1");
//$mentah_suhu = shell_exec("cat /sys/bus/iio/devices/iio:device0/in_voltage1_raw");
$temperature = shell_exec("python python/sensor2_fahrenheit.py");
//$millivolt = ($mentah_suhu/4096.0) * 1800;
//$temperature = ($millivolt / 10.0);
//$fahrenheit = ($temperature * 9/5) + 32;
echo number_format($temperature,1);
//echo number_format($temperature,1);
//echo $mentah_suhu;*/z
//echo 45.0;
}