<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>The SR04 works by sending a trigger signal and waiting for the
echo signal. It then calculates the time between the two signals
and translates this to distance. All this happens in the pulseIn()
function used with this sensor.</p>
<p>In order to make it work with Firmata you must send a signal out
the trigger pin and as soon as you receive a signal from the echo
pin you must do the math to make the conversion, meaning, you must
translate the workings of pulseIn() to a Pd patch. Connecting a
pin of the sensor to an analog pin simply doesn't make sense.</p>
<p>You can instead use the code that is provided (don't know where,
but there are some examples for this sensor, right?), and on the
Pd side use [serial_print], an abstraction that works with
Arduino's Serial.print() function. You can get it here
<a class="moz-txt-link-freetext" href="https://github.com/alexdrymonitis/Arduino_Pd">https://github.com/alexdrymonitis/Arduino_Pd</a></p>
<p>Make sure you read both the help patch and the Arduino sketch in
order to make the appropriate changes to your code.<br>
</p>
<br>
<div class="moz-cite-prefix">On 06/02/2018 06:16 πμ, ray Y wrote:<br>
</div>
<blockquote type="cite"
cite="mid:MWHPR1201MB0128C6046E3DE41CBB5E8473AAFD0@MWHPR1201MB0128.namprd12.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;"
dir="ltr">
<p style="margin-top:0;margin-bottom:0">is there a work around
for this? <br>
</p>
<p style="margin-top:0;margin-bottom:0">the sr-04 is a way
cooler sensor than the ones supported by</p>
<p style="margin-top:0;margin-bottom:0">standardfirmata! <br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">why is it not supported?</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">there most be a hack to
make the emiter and receiver</p>
<p style="margin-top:0;margin-bottom:0">functions act as one
with the signal going into the analog</p>
<p style="margin-top:0;margin-bottom:0">inputs of the arduino.
as a standard sensor?<br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">wow, i google and there
is almost nothing out there about this</p>
<p style="margin-top:0;margin-bottom:0">i'm a bit tired of
trying to do this</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">please help</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">thanks</p>
<p style="margin-top:0;margin-bottom:0">r.y<br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
<a class="moz-txt-link-abbreviated" href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list
UNSUBSCRIBE and account-management -> <a class="moz-txt-link-freetext" href="https://lists.puredata.info/listinfo/pd-list">https://lists.puredata.info/listinfo/pd-list</a>
</pre>
</blockquote>
<br>
</body>
</html>