sounds and data
This commit is contained in:
parent
811274f7e3
commit
b02cb7d35b
37 changed files with 319 additions and 0 deletions
33
sounds/aup/nix.00001.aup
Normal file
33
sounds/aup/nix.00001.aup
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
<?xml version="1.0" standalone="no" ?>
|
||||||
|
<!DOCTYPE project PUBLIC "-//audacityproject-1.3.0//DTD//EN" "http://audacity.sourceforge.net/xml/audacityproject-1.3.0.dtd" >
|
||||||
|
<project xmlns="http://audacity.sourceforge.net/xml/" projname="nix.00001_data" version="1.3.0" audacityversion="1.3.8" sel0="0.0000000000" sel1="0.0000000000" vpos="0" h="0.0000000000" zoom="344.5312500000" rate="44100">
|
||||||
|
<tags>
|
||||||
|
<tag name="id3v2" value="1"/>
|
||||||
|
</tags>
|
||||||
|
<wavetrack name="Audio Track" channel="0" linked="1" offset="0.00000000" mute="0" solo="0" height="150" minimized="0" rate="44100" gain="1" pan="0">
|
||||||
|
<waveclip offset="0.00000000">
|
||||||
|
<sequence maxsamples="262144" sampleformat="262159" numsamples="30233">
|
||||||
|
<waveblock start="0">
|
||||||
|
<simpleblockfile filename="e0000bbe.au" len="1648" min="-0.202502" max="0.188865" rms="0.0137"/>
|
||||||
|
</waveblock>
|
||||||
|
<waveblock start="1648">
|
||||||
|
<simpleblockfile filename="e0000a10.au" len="28585" min="-0.389071" max="0.314807" rms="0.054123"/>
|
||||||
|
</waveblock>
|
||||||
|
</sequence>
|
||||||
|
<envelope numpoints="0"/>
|
||||||
|
</waveclip>
|
||||||
|
</wavetrack>
|
||||||
|
<wavetrack name="Audio Track" channel="1" linked="0" offset="0.00000000" mute="0" solo="0" height="150" minimized="0" rate="44100" gain="1" pan="0">
|
||||||
|
<waveclip offset="0.00000000">
|
||||||
|
<sequence maxsamples="262144" sampleformat="262159" numsamples="30233">
|
||||||
|
<waveblock start="0">
|
||||||
|
<simpleblockfile filename="e0000966.au" len="1648" min="-0.202502" max="0.188787" rms="0.0137"/>
|
||||||
|
</waveblock>
|
||||||
|
<waveblock start="1648">
|
||||||
|
<simpleblockfile filename="e00003b0.au" len="28585" min="-0.389071" max="0.314807" rms="0.054123"/>
|
||||||
|
</waveblock>
|
||||||
|
</sequence>
|
||||||
|
<envelope numpoints="0"/>
|
||||||
|
</waveclip>
|
||||||
|
</wavetrack>
|
||||||
|
</project>
|
BIN
sounds/aup/nix.00001_data/e00/d00/e00003b0.au
Normal file
BIN
sounds/aup/nix.00001_data/e00/d00/e00003b0.au
Normal file
Binary file not shown.
BIN
sounds/aup/nix.00001_data/e00/d00/e0000966.au
Normal file
BIN
sounds/aup/nix.00001_data/e00/d00/e0000966.au
Normal file
Binary file not shown.
BIN
sounds/aup/nix.00001_data/e00/d00/e0000a10.au
Normal file
BIN
sounds/aup/nix.00001_data/e00/d00/e0000a10.au
Normal file
Binary file not shown.
BIN
sounds/aup/nix.00001_data/e00/d00/e0000bbe.au
Normal file
BIN
sounds/aup/nix.00001_data/e00/d00/e0000bbe.au
Normal file
Binary file not shown.
27
sounds/aup/nix.00201.aup
Normal file
27
sounds/aup/nix.00201.aup
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<?xml version="1.0" standalone="no" ?>
|
||||||
|
<!DOCTYPE project PUBLIC "-//audacityproject-1.3.0//DTD//EN" "http://audacity.sourceforge.net/xml/audacityproject-1.3.0.dtd" >
|
||||||
|
<project xmlns="http://audacity.sourceforge.net/xml/" projname="nix.00201_data" version="1.3.0" audacityversion="1.3.8" sel0="0.0000000000" sel1="0.4411111111" vpos="0" h="0.0000000000" zoom="1378.1250000000" rate="44100">
|
||||||
|
<tags>
|
||||||
|
<tag name="id3v2" value="1"/>
|
||||||
|
</tags>
|
||||||
|
<wavetrack name="Audio Track" channel="0" linked="1" offset="0.00000000" mute="0" solo="0" height="150" minimized="0" rate="44100" gain="1" pan="0">
|
||||||
|
<waveclip offset="0.00000000">
|
||||||
|
<sequence maxsamples="262144" sampleformat="262159" numsamples="19453">
|
||||||
|
<waveblock start="0">
|
||||||
|
<simpleblockfile filename="e0000a8b.au" len="19453" min="-0.947322" max="0.924414" rms="0.115413"/>
|
||||||
|
</waveblock>
|
||||||
|
</sequence>
|
||||||
|
<envelope numpoints="0"/>
|
||||||
|
</waveclip>
|
||||||
|
</wavetrack>
|
||||||
|
<wavetrack name="Audio Track" channel="1" linked="0" offset="0.00000000" mute="0" solo="0" height="150" minimized="0" rate="44100" gain="1" pan="0">
|
||||||
|
<waveclip offset="0.00000000">
|
||||||
|
<sequence maxsamples="262144" sampleformat="262159" numsamples="19453">
|
||||||
|
<waveblock start="0">
|
||||||
|
<simpleblockfile filename="e000073f.au" len="19453" min="-0.846599" max="0.915446" rms="0.110856"/>
|
||||||
|
</waveblock>
|
||||||
|
</sequence>
|
||||||
|
<envelope numpoints="0"/>
|
||||||
|
</waveclip>
|
||||||
|
</wavetrack>
|
||||||
|
</project>
|
BIN
sounds/aup/nix.00201_data/e00/d00/e000073f.au
Normal file
BIN
sounds/aup/nix.00201_data/e00/d00/e000073f.au
Normal file
Binary file not shown.
BIN
sounds/aup/nix.00201_data/e00/d00/e0000a8b.au
Normal file
BIN
sounds/aup/nix.00201_data/e00/d00/e0000a8b.au
Normal file
Binary file not shown.
27
sounds/aup/nix.00203.aup
Normal file
27
sounds/aup/nix.00203.aup
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<?xml version="1.0" standalone="no" ?>
|
||||||
|
<!DOCTYPE project PUBLIC "-//audacityproject-1.3.0//DTD//EN" "http://audacity.sourceforge.net/xml/audacityproject-1.3.0.dtd" >
|
||||||
|
<project xmlns="http://audacity.sourceforge.net/xml/" projname="nix.00203_data" version="1.3.0" audacityversion="1.3.8" sel0="0.0000000000" sel1="0.4411111111" vpos="0" h="0.0000000000" zoom="2520.9068010076" rate="44100">
|
||||||
|
<tags>
|
||||||
|
<tag name="id3v2" value="1"/>
|
||||||
|
</tags>
|
||||||
|
<wavetrack name="Audio Track" channel="0" linked="1" offset="0.00000000" mute="0" solo="0" height="150" minimized="0" rate="44100" gain="1" pan="0">
|
||||||
|
<waveclip offset="0.00000000">
|
||||||
|
<sequence maxsamples="262144" sampleformat="262159" numsamples="19453">
|
||||||
|
<waveblock start="0">
|
||||||
|
<simpleblockfile filename="e0000a8b.au" len="19453" min="-0.947322" max="0.924414" rms="0.115413"/>
|
||||||
|
</waveblock>
|
||||||
|
</sequence>
|
||||||
|
<envelope numpoints="0"/>
|
||||||
|
</waveclip>
|
||||||
|
</wavetrack>
|
||||||
|
<wavetrack name="Audio Track" channel="1" linked="0" offset="0.00000000" mute="0" solo="0" height="150" minimized="0" rate="44100" gain="1" pan="0">
|
||||||
|
<waveclip offset="0.00000000">
|
||||||
|
<sequence maxsamples="262144" sampleformat="262159" numsamples="19453">
|
||||||
|
<waveblock start="0">
|
||||||
|
<simpleblockfile filename="e000073f.au" len="19453" min="-0.846599" max="0.915446" rms="0.110856"/>
|
||||||
|
</waveblock>
|
||||||
|
</sequence>
|
||||||
|
<envelope numpoints="0"/>
|
||||||
|
</waveclip>
|
||||||
|
</wavetrack>
|
||||||
|
</project>
|
BIN
sounds/aup/nix.00203_data/e00/d00/e000073f.au
Normal file
BIN
sounds/aup/nix.00203_data/e00/d00/e000073f.au
Normal file
Binary file not shown.
BIN
sounds/aup/nix.00203_data/e00/d00/e0000a8b.au
Normal file
BIN
sounds/aup/nix.00203_data/e00/d00/e0000a8b.au
Normal file
Binary file not shown.
33
sounds/aup/nix.09903.aup
Normal file
33
sounds/aup/nix.09903.aup
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
<?xml version="1.0" standalone="no" ?>
|
||||||
|
<!DOCTYPE project PUBLIC "-//audacityproject-1.3.0//DTD//EN" "http://audacity.sourceforge.net/xml/audacityproject-1.3.0.dtd" >
|
||||||
|
<project xmlns="http://audacity.sourceforge.net/xml/" projname="nix.09903_data" version="1.3.0" audacityversion="1.3.8" sel0="0.0000000000" sel1="9.0371655329" vpos="0" h="0.0000000000" zoom="104.0048016051" rate="44100">
|
||||||
|
<tags>
|
||||||
|
<tag name="id3v2" value="1"/>
|
||||||
|
</tags>
|
||||||
|
<wavetrack name="Audio Track" channel="0" linked="1" offset="0.00000000" mute="0" solo="0" height="150" minimized="0" rate="44100" gain="1" pan="0">
|
||||||
|
<waveclip offset="0.00000000">
|
||||||
|
<sequence maxsamples="262144" sampleformat="262159" numsamples="398539">
|
||||||
|
<waveblock start="0">
|
||||||
|
<simpleblockfile filename="e0000d86.au" len="262144" min="-1.002122" max="0.86765" rms="0.423206"/>
|
||||||
|
</waveblock>
|
||||||
|
<waveblock start="262144">
|
||||||
|
<simpleblockfile filename="e0000863.au" len="136395" min="-0.942672" max="0.857035" rms="0.360883"/>
|
||||||
|
</waveblock>
|
||||||
|
</sequence>
|
||||||
|
<envelope numpoints="0"/>
|
||||||
|
</waveclip>
|
||||||
|
</wavetrack>
|
||||||
|
<wavetrack name="Audio Track" channel="1" linked="0" offset="0.00000000" mute="0" solo="0" height="150" minimized="0" rate="44100" gain="1" pan="0">
|
||||||
|
<waveclip offset="0.00000000">
|
||||||
|
<sequence maxsamples="262144" sampleformat="262159" numsamples="398539">
|
||||||
|
<waveblock start="0">
|
||||||
|
<simpleblockfile filename="e00008bd.au" len="262144" min="-0.411491" max="0.493823" rms="0.169071"/>
|
||||||
|
</waveblock>
|
||||||
|
<waveblock start="262144">
|
||||||
|
<simpleblockfile filename="e0000ce4.au" len="136395" min="-0.402754" max="0.52502" rms="0.144151"/>
|
||||||
|
</waveblock>
|
||||||
|
</sequence>
|
||||||
|
<envelope numpoints="0"/>
|
||||||
|
</waveclip>
|
||||||
|
</wavetrack>
|
||||||
|
</project>
|
BIN
sounds/aup/nix.09903_data/e00/d00/e0000863.au
Normal file
BIN
sounds/aup/nix.09903_data/e00/d00/e0000863.au
Normal file
Binary file not shown.
BIN
sounds/aup/nix.09903_data/e00/d00/e00008bd.au
Normal file
BIN
sounds/aup/nix.09903_data/e00/d00/e00008bd.au
Normal file
Binary file not shown.
BIN
sounds/aup/nix.09903_data/e00/d00/e0000ce4.au
Normal file
BIN
sounds/aup/nix.09903_data/e00/d00/e0000ce4.au
Normal file
Binary file not shown.
BIN
sounds/aup/nix.09903_data/e00/d00/e0000d86.au
Normal file
BIN
sounds/aup/nix.09903_data/e00/d00/e0000d86.au
Normal file
Binary file not shown.
27
sounds/aup/patapotato.aup
Normal file
27
sounds/aup/patapotato.aup
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<?xml version="1.0" standalone="no" ?>
|
||||||
|
<!DOCTYPE project PUBLIC "-//audacityproject-1.3.0//DTD//EN" "http://audacity.sourceforge.net/xml/audacityproject-1.3.0.dtd" >
|
||||||
|
<project xmlns="http://audacity.sourceforge.net/xml/" projname="patapotato_data" version="1.3.0" audacityversion="1.3.8" sel0="0.0232199546" sel1="0.1131972789" vpos="0" h="0.0000000000" zoom="344.5312500000" rate="44100">
|
||||||
|
<tags>
|
||||||
|
<tag name="id3v2" value="1"/>
|
||||||
|
</tags>
|
||||||
|
<wavetrack name="Audio Track" channel="0" linked="1" offset="0.00000000" mute="0" solo="0" height="150" minimized="0" rate="44100" gain="1" pan="0">
|
||||||
|
<waveclip offset="0.00000000">
|
||||||
|
<sequence maxsamples="262144" sampleformat="262159" numsamples="76544">
|
||||||
|
<waveblock start="0">
|
||||||
|
<simpleblockfile filename="e0000e18.au" len="76544" min="-0.372418" max="0.371792" rms="0.047522"/>
|
||||||
|
</waveblock>
|
||||||
|
</sequence>
|
||||||
|
<envelope numpoints="0"/>
|
||||||
|
</waveclip>
|
||||||
|
</wavetrack>
|
||||||
|
<wavetrack name="Audio Track" channel="1" linked="0" offset="0.00000000" mute="0" solo="0" height="150" minimized="0" rate="44100" gain="1" pan="0">
|
||||||
|
<waveclip offset="0.00000000">
|
||||||
|
<sequence maxsamples="262144" sampleformat="262159" numsamples="76544">
|
||||||
|
<waveblock start="0">
|
||||||
|
<simpleblockfile filename="e0000df6.au" len="76544" min="-0.479038" max="0.336583" rms="0.038412"/>
|
||||||
|
</waveblock>
|
||||||
|
</sequence>
|
||||||
|
<envelope numpoints="0"/>
|
||||||
|
</waveclip>
|
||||||
|
</wavetrack>
|
||||||
|
</project>
|
BIN
sounds/aup/patapotato_data/e00/d00/e00004f4.au
Normal file
BIN
sounds/aup/patapotato_data/e00/d00/e00004f4.au
Normal file
Binary file not shown.
BIN
sounds/aup/patapotato_data/e00/d00/e0000733.au
Normal file
BIN
sounds/aup/patapotato_data/e00/d00/e0000733.au
Normal file
Binary file not shown.
BIN
sounds/aup/patapotato_data/e00/d00/e0000df6.au
Normal file
BIN
sounds/aup/patapotato_data/e00/d00/e0000df6.au
Normal file
Binary file not shown.
BIN
sounds/aup/patapotato_data/e00/d00/e0000e18.au
Normal file
BIN
sounds/aup/patapotato_data/e00/d00/e0000e18.au
Normal file
Binary file not shown.
27
sounds/aup/potatox.2221.aup
Normal file
27
sounds/aup/potatox.2221.aup
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<?xml version="1.0" standalone="no" ?>
|
||||||
|
<!DOCTYPE project PUBLIC "-//audacityproject-1.3.0//DTD//EN" "http://audacity.sourceforge.net/xml/audacityproject-1.3.0.dtd" >
|
||||||
|
<project xmlns="http://audacity.sourceforge.net/xml/" projname="potatox.2221_data" version="1.3.0" audacityversion="1.3.8" sel0="0.0123356009" sel1="0.0123356009" vpos="0" h="0.0000000000" zoom="1378.1250000000" rate="44100">
|
||||||
|
<tags>
|
||||||
|
<tag name="id3v2" value="1"/>
|
||||||
|
</tags>
|
||||||
|
<wavetrack name="Audio Track" channel="0" linked="1" offset="0.00000000" mute="0" solo="0" height="150" minimized="0" rate="44100" gain="1" pan="0">
|
||||||
|
<waveclip offset="0.00000000">
|
||||||
|
<sequence maxsamples="262144" sampleformat="262159" numsamples="14464">
|
||||||
|
<waveblock start="0">
|
||||||
|
<simpleblockfile filename="e0000fbe.au" len="14464" min="-0.372418" max="0.371792" rms="0.036593"/>
|
||||||
|
</waveblock>
|
||||||
|
</sequence>
|
||||||
|
<envelope numpoints="0"/>
|
||||||
|
</waveclip>
|
||||||
|
</wavetrack>
|
||||||
|
<wavetrack name="Audio Track" channel="1" linked="0" offset="0.00000000" mute="0" solo="0" height="150" minimized="0" rate="44100" gain="1" pan="0">
|
||||||
|
<waveclip offset="0.00000000">
|
||||||
|
<sequence maxsamples="262144" sampleformat="262159" numsamples="14464">
|
||||||
|
<waveblock start="0">
|
||||||
|
<simpleblockfile filename="e0000916.au" len="14464" min="-0.218958" max="0.250051" rms="0.025392"/>
|
||||||
|
</waveblock>
|
||||||
|
</sequence>
|
||||||
|
<envelope numpoints="0"/>
|
||||||
|
</waveclip>
|
||||||
|
</wavetrack>
|
||||||
|
</project>
|
BIN
sounds/aup/potatox.2221_data/e00/d00/e0000916.au
Normal file
BIN
sounds/aup/potatox.2221_data/e00/d00/e0000916.au
Normal file
Binary file not shown.
BIN
sounds/aup/potatox.2221_data/e00/d00/e0000fbe.au
Normal file
BIN
sounds/aup/potatox.2221_data/e00/d00/e0000fbe.au
Normal file
Binary file not shown.
33
sounds/aup/watering-can.aup
Normal file
33
sounds/aup/watering-can.aup
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
<?xml version="1.0" standalone="no" ?>
|
||||||
|
<!DOCTYPE project PUBLIC "-//audacityproject-1.3.0//DTD//EN" "http://audacity.sourceforge.net/xml/audacityproject-1.3.0.dtd" >
|
||||||
|
<project xmlns="http://audacity.sourceforge.net/xml/" projname="watering-can_data" version="1.3.0" audacityversion="1.3.8" sel0="0.0000000000" sel1="0.0000000000" vpos="0" h="0.0000000000" zoom="344.5312500000" rate="44100">
|
||||||
|
<tags>
|
||||||
|
<tag name="id3v2" value="1"/>
|
||||||
|
</tags>
|
||||||
|
<wavetrack name="Audio Track" channel="0" linked="1" offset="0.00000000" mute="0" solo="0" height="150" minimized="0" rate="44100" gain="1" pan="0">
|
||||||
|
<waveclip offset="0.00000000">
|
||||||
|
<sequence maxsamples="262144" sampleformat="262159" numsamples="30233">
|
||||||
|
<waveblock start="0">
|
||||||
|
<simpleblockfile filename="e0000bbe.au" len="1648" min="-0.202502" max="0.188865" rms="0.0137"/>
|
||||||
|
</waveblock>
|
||||||
|
<waveblock start="1648">
|
||||||
|
<simpleblockfile filename="e0000a10.au" len="28585" min="-0.389071" max="0.314807" rms="0.054123"/>
|
||||||
|
</waveblock>
|
||||||
|
</sequence>
|
||||||
|
<envelope numpoints="0"/>
|
||||||
|
</waveclip>
|
||||||
|
</wavetrack>
|
||||||
|
<wavetrack name="Audio Track" channel="1" linked="0" offset="0.00000000" mute="0" solo="0" height="150" minimized="0" rate="44100" gain="1" pan="0">
|
||||||
|
<waveclip offset="0.00000000">
|
||||||
|
<sequence maxsamples="262144" sampleformat="262159" numsamples="30233">
|
||||||
|
<waveblock start="0">
|
||||||
|
<simpleblockfile filename="e0000966.au" len="1648" min="-0.202502" max="0.188787" rms="0.0137"/>
|
||||||
|
</waveblock>
|
||||||
|
<waveblock start="1648">
|
||||||
|
<simpleblockfile filename="e00003b0.au" len="28585" min="-0.389071" max="0.314807" rms="0.054123"/>
|
||||||
|
</waveblock>
|
||||||
|
</sequence>
|
||||||
|
<envelope numpoints="0"/>
|
||||||
|
</waveclip>
|
||||||
|
</wavetrack>
|
||||||
|
</project>
|
BIN
sounds/aup/watering-can_data/e00/d00/e00003b0.au
Normal file
BIN
sounds/aup/watering-can_data/e00/d00/e00003b0.au
Normal file
Binary file not shown.
BIN
sounds/aup/watering-can_data/e00/d00/e0000966.au
Normal file
BIN
sounds/aup/watering-can_data/e00/d00/e0000966.au
Normal file
Binary file not shown.
BIN
sounds/aup/watering-can_data/e00/d00/e0000a10.au
Normal file
BIN
sounds/aup/watering-can_data/e00/d00/e0000a10.au
Normal file
Binary file not shown.
BIN
sounds/aup/watering-can_data/e00/d00/e0000bbe.au
Normal file
BIN
sounds/aup/watering-can_data/e00/d00/e0000bbe.au
Normal file
Binary file not shown.
BIN
sounds/wavs/nix.00203.wav
Normal file
BIN
sounds/wavs/nix.00203.wav
Normal file
Binary file not shown.
BIN
sounds/wavs/nix.09903.wav
Normal file
BIN
sounds/wavs/nix.09903.wav
Normal file
Binary file not shown.
BIN
sounds/wavs/potatox.2221.wav
Normal file
BIN
sounds/wavs/potatox.2221.wav
Normal file
Binary file not shown.
BIN
sounds/wavs/potatox.2881.wav
Normal file
BIN
sounds/wavs/potatox.2881.wav
Normal file
Binary file not shown.
BIN
sounds/wavs/wateringcan.wav
Normal file
BIN
sounds/wavs/wateringcan.wav
Normal file
Binary file not shown.
35
xylem/xylem_lawrence/biosensor.scm
Executable file
35
xylem/xylem_lawrence/biosensor.scm
Executable file
|
@ -0,0 +1,35 @@
|
||||||
|
|
||||||
|
(require net/url
|
||||||
|
fluxus-016/fluxa)
|
||||||
|
|
||||||
|
(define serial (open-input-file "/dev/tty.usbserial-A200294d"))
|
||||||
|
|
||||||
|
(define (read-serial)
|
||||||
|
(process (read-line serial))
|
||||||
|
(read-serial))
|
||||||
|
|
||||||
|
(define (process str)
|
||||||
|
(let ([data (regexp-split #rx"," str)])
|
||||||
|
(printf "biosense: ~a~n" (list-ref data 1))
|
||||||
|
(data->noise (list-ref data 1))))
|
||||||
|
|
||||||
|
|
||||||
|
(define (data->noise l)
|
||||||
|
(play-now (mul (1of2 (saw 40) (sine 30))
|
||||||
|
(string->number l))))
|
||||||
|
|
||||||
|
|
||||||
|
(define (x n)
|
||||||
|
(cond ((not (zero? n))
|
||||||
|
(play-now (mul (saw (random 600)) (adsr 1 0 (rndf) 1)))
|
||||||
|
(sleep 0.1)
|
||||||
|
(x (- n 1)))))
|
||||||
|
|
||||||
|
(define (1of2 x y)
|
||||||
|
(if (> 1 (random 2)) x y ))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(x 33)
|
||||||
|
|
||||||
|
;(read-serial)
|
37
xylem/xylem_lawrence/serial->xmpp.scm
Executable file
37
xylem/xylem_lawrence/serial->xmpp.scm
Executable file
|
@ -0,0 +1,37 @@
|
||||||
|
;; send sensor data via xmpp
|
||||||
|
|
||||||
|
|
||||||
|
(module serial->xmpp scheme
|
||||||
|
|
||||||
|
(require (planet zzkt/xmpp))
|
||||||
|
(provide (all-defined-out))
|
||||||
|
|
||||||
|
(define serial (open-input-file "/dev/tty.usbserial-A9007Lgy"))
|
||||||
|
|
||||||
|
(define (read-serial)
|
||||||
|
(process (read-line serial))
|
||||||
|
;(read-serial)
|
||||||
|
)
|
||||||
|
|
||||||
|
(define (scale b t n)
|
||||||
|
(/ (- t (/ (string->number n) 1024.0)) (- t b)))
|
||||||
|
|
||||||
|
(define (process str)
|
||||||
|
(let ([data (regexp-split #rx"," str)])
|
||||||
|
(format "vrob light-level=n:~a soil-moisture=n:~a"
|
||||||
|
(scale 0.9 1 (list-ref data 1))
|
||||||
|
(scale 0 1.0 (list-ref data 2)))))
|
||||||
|
|
||||||
|
;; send via xmpp
|
||||||
|
|
||||||
|
(define (send-data)
|
||||||
|
(with-xmpp-session "plant0000005@fo.am" "plant0000005"
|
||||||
|
(let sendrec ()
|
||||||
|
(begin (send (message "plant0000003@fo.am" (read-serial)))
|
||||||
|
(sleep 0.5)
|
||||||
|
(sendrec)))))
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
40
xylem/xylem_lawrence/xylem_lawrence.pde
Normal file
40
xylem/xylem_lawrence/xylem_lawrence.pde
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
///////////// part of the groworld HPI prototype
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define sense 0 // biosensor on analog pin 0
|
||||||
|
#define power 8 // power for sensors
|
||||||
|
|
||||||
|
unsigned long then = 0; // timer which will run for < 50 days
|
||||||
|
unsigned long interval = 10; // interval between reads in seconds
|
||||||
|
|
||||||
|
///////////// set up & send
|
||||||
|
|
||||||
|
void setup()
|
||||||
|
{
|
||||||
|
pinMode(power, OUTPUT);
|
||||||
|
pinMode(sense, INPUT);
|
||||||
|
Serial.begin(9600);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int readlevel ()
|
||||||
|
{
|
||||||
|
int level = 0;
|
||||||
|
level = (analogRead(sense));
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
|
||||||
|
char display[64];
|
||||||
|
|
||||||
|
void loop()
|
||||||
|
{
|
||||||
|
if (millis() - then > interval*1000) {
|
||||||
|
then = millis();
|
||||||
|
sprintf(display, "%u,%u\n", (unsigned int)then, readlevel());
|
||||||
|
Serial.print(display);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////
|
||||||
|
|
Loading…
Reference in a new issue