max4260 / webiopi

Automatically exported from code.google.com/p/webiopi
0 stars 0 forks source link

Timer #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Will it be  possible to add to the REST API an option to change the state of a 
pin for x seconds? As example: "HTTP POST /GPIO/(gpioNumber)/value/(0 or 
1)/xxxx" where xxxx is the seconds the pin will be on or off and after the xxxx 
second the pin will return to the old state.

When this is possible it will be so incredible great. My knowledge of python is 
not large enough to program it myself.

Thanks in advance.

Original issue reported on code.google.com by wouter.n...@gmail.com on 10 Dec 2012 at 8:47

GoogleCodeExporter commented 9 years ago
You can do this already with the output sequence feature:

•HTTP POST /GPIO/(gpioNumber)/sequence/(delay),(sequence)

e.g.:
set GPIO 7 to be an output:
- HTTP POST /GPIO/7/function/out 

Possiblility 1:
set it to be low (may be omitted)
- HTTP POST /GPIO/7/value/0
then let it be high for 10 seconds and then return to low 
- HTTP POST /GPIO/7/sequence/10000,10

Possiblility 2:
or alternatively if you can live with 10 sec low as first sequence step
- HTTP POST /GPIO/7/sequence/10000,010 

Original comment by andreas....@googlemail.com on 18 Dec 2012 at 9:12

GoogleCodeExporter commented 9 years ago
thanks andreas to giving the solution

Original comment by tro...@trouch.com on 20 Dec 2012 at 10:37

GoogleCodeExporter commented 9 years ago
Thanks Andreas, sorry for missing this

Original comment by wouter.n...@gmail.com on 20 Dec 2012 at 2:19