| 1 | <refentry id="arduinoRead"> |
| 2 | <indexterm |
| 3 | id="IndexArduinoRead"><primary>arduinoRead</primary></indexterm> |
| 4 | |
| 5 | <refentryinfo><title>Serial I/O</title></refentryinfo> |
| 6 | <refmeta> |
| 7 | <refentrytitle>arduinoRead</refentrytitle> |
| 8 | </refmeta> |
| 9 | |
| 10 | <refnamediv> |
| 11 | <refname>arduinoRead</refname> |
| 12 | <refpurpose> |
| 13 | Read data from an arduino port using the Csound-Arduino protocol. |
| 14 | </refpurpose> |
| 15 | </refnamediv> |
| 16 | |
| 17 | <refsect1> |
| 18 | <title>Description</title> |
| 19 | <para>Plugin opcode in serial.</para> |
| 20 | <para> |
| 21 | Read integer data from an arduino port with CsoundArduino protocol. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis>kval <command>arduinoRead</command> iPort, iStream[, iSmooth]</synopsis> |
| 28 | </refsect1> |
| 29 | |
| 30 | <refsect1> |
| 31 | <title>Performance</title> |
| 32 | <para> |
| 33 | <emphasis>iPort</emphasis> -- port number obtained from a |
| 34 | <emphasis>arduinoStart</emphasis> opcode. |
| 35 | </para> |
| 36 | <para> |
| 37 | <emphasis>iStream</emphasis> -- Number of the data stream in |
| 38 | range 0 to 30. |
| 39 | </para> |
| 40 | <para> |
| 41 | <emphasis>iSmooth</emphasis> -- halftime of a portamento filter |
| 42 | to smooth the stream of data. Defaults to 0 meaning no filtering. |
| 43 | </para> |
| 44 | <para> |
| 45 | <emphasis>kval</emphasis> -- data to read in range [0, 1023]. |
| 46 | </para> |
| 47 | </refsect1> |
| 48 | |
| 49 | <refsect1> |
| 50 | <title>Examples</title> |
| 51 | <para> |
| 52 | Here is an example of the arduinoRead opcode. It uses the file <ulink url="examples/arduinoRead.csd"><citetitle>arduinoRead.csd</citetitle></ulink>. |
| 53 | <example> |
| 54 | <title>Example of the arduinoRead opcode.</title> |
| 55 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 56 | <xi:include href="examples-xml/arduinoRead.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 57 | </example> |
| 58 | </para> |
| 59 | </refsect1> |
| 60 | |
| 61 | <refsect1> |
| 62 | <title>See Also</title> |
| 63 | <para><link linkend="nonMIDIdevices"><citetitle>non-MIDI Devices</citetitle></link></para> |
| 64 | <para> More information: <ulink url="https://csound.com/icsc2022/proceedings/New%20Arduino%20Opcodes%20to%20Simplify%20the%20Streaming%20of%20Sensor%20and%20Controller%20Data%20to%20Csound.pdf"><citetitle>New Arduino Opcodes to Simplify the Streaming of Sensor and Controller Data to Csound</citetitle></ulink></para> |
| 65 | </refsect1> |
| 66 | |
| 67 | <refsect1> |
| 68 | <title>Credits</title> |
| 69 | <para> |
| 70 | <simplelist> |
| 71 | <member>Author: &namejohn;</member> |
| 72 | <member>Author: Richard Boulanger</member> |
| 73 | <member>2020</member> |
| 74 | </simplelist> |
| 75 | </para> |
| 76 | <para>New in version 6.15</para> |
| 77 | </refsect1> |
| 78 | </refentry> |