diff --git a/api/set_light.php b/api/set_light.php index 428905f..77df9b2 100644 --- a/api/set_light.php +++ b/api/set_light.php @@ -1,5 +1,6 @@ \ No newline at end of file +$output = null; +exec('bash ../scripts/led.sh '.$light, $output); +var_dump($output); +?> diff --git a/api/temp.php b/api/temp.php old mode 100644 new mode 100755 index 4c97ee4..4cfdca3 --- a/api/temp.php +++ b/api/temp.php @@ -1,4 +1,4 @@ \ No newline at end of file +?> diff --git a/scripts/get_temp.sh b/scripts/get_temp.sh index 92747a3..7a36491 100755 --- a/scripts/get_temp.sh +++ b/scripts/get_temp.sh @@ -1,6 +1,6 @@ #!/bin/bash -response=`i2cget -y 1 0x18 0x05 w` +response=`/usr/sbin/i2cget -y 1 0x18 0x05 w` upper_byte=$(($response & 0x00FF)) lower_byte=$(($response & 0xFF00)) let "sign=0" @@ -13,5 +13,4 @@ else upper_byte=$((upper_byte & 0x0F)) let "temperature = ($upper_byte*100 * 16 + $lower_byte*100 / 4096)" fi -# printf %.2f "$(($temperature))e-2" -echo $temperature > toto; +printf %.2f "$(($temperature))e-2" diff --git a/scripts/led.sh b/scripts/led.sh index b1dc3c8..6449958 100755 --- a/scripts/led.sh +++ b/scripts/led.sh @@ -1,7 +1,8 @@ #!/bin/bash - +echo $1 gpio mode $1 out let "out=`gpio read $1`" +echo $out if [ $out = 1 ] then gpio write $1 0 diff --git a/scripts/toto b/scripts/toto new file mode 100644 index 0000000..573541a --- /dev/null +++ b/scripts/toto @@ -0,0 +1 @@ +0 diff --git a/start_dev.sh b/start_dev.sh old mode 100644 new mode 100755 diff --git a/test.php b/test.php new file mode 100644 index 0000000..61147d4 --- /dev/null +++ b/test.php @@ -0,0 +1,5 @@ + diff --git a/toto b/toto new file mode 100644 index 0000000..573541a --- /dev/null +++ b/toto @@ -0,0 +1 @@ +0