Browse Source

3.141592653589793238

master
BARRAUX Arthur 2 years ago
parent
commit
576a526671
  1. 0
      api/get_light.php
  2. 2
      api/set_light.php
  3. 0
      assets/index.62d9ce6a.js
  4. 0
      assets/index.8b2241a3.css
  5. 0
      index.html
  6. 10
      scripts/set_light.sh

0
api/get_light.php

2
api/set_light.php

@ -2,5 +2,5 @@
$light = $_GET["light"]; $light = $_GET["light"];
$output = null; $output = null;
exec('bash ../scripts/set_light.sh '.$light, $output); exec('bash ../scripts/set_light.sh '.$light, $output);
var_dump($output); echo $output[0];
?> ?>

0
assets/index.62d9ce6a.js

0
assets/index.8b2241a3.css

0
index.html

10
scripts/set_light.sh

@ -1,5 +1,11 @@
#!/bin/bash #!/bin/bash
gpio mode $1 out gpio mode $1 out
let "out=`gpio read $1`" let "out=`gpio read $1`"
gpio write $1 $out if [ $out = 0 ]
echo $out then
gpio write $1 1
echo 1
else
gpio write $1 0
echo 0
fi

Loading…
Cancel
Save