| 1 | <refentry id="arduinoReadF"> |
| 2 | <indexterm |
| 3 | id="IndexArduinoReadF"><primary>arduinoReadF</primary></indexterm> |
| 4 | |
| 5 | <refentryinfo><title>Serial I/O</title></refentryinfo> |
| 6 | <refmeta> |
| 7 | <refentrytitle>arduinoReadF</refentrytitle> |
| 8 | </refmeta> |
| 9 | |
| 10 | <refnamediv> |
| 11 | <refname>arduinoReadF</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>arduinoReadF</command> iPort, iStream1, |
| 28 | iStream2, iStream3</synopsis> |
| 29 | </refsect1> |
| 30 | |
| 31 | <refsect1> |
| 32 | <title>Performance</title> |
| 33 | <para> |
| 34 | <emphasis>iPort</emphasis> -- port number obtained from a |
| 35 | <emphasis>arduinoStart</emphasis> opcode. |
| 36 | </para> |
| 37 | <para> |
| 38 | <emphasis>iStream1, iStream2, iStream3</emphasis> -- Numbers of |
| 39 | the three data streams in the range 0 to 30. Each stream |
| 40 | carries 10 bits of the 30 bits floating point result. The division |
| 41 | is created in the Arduino sketch encapsulated in the put_float function. |
| 42 | </para> |
| 43 | <para> |
| 44 | <emphasis>kval</emphasis> -- floating point value read. |
| 45 | </para> |
| 46 | <note>The value transmitted is two bits shorter in the mantissa |
| 47 | than produced on the Arduino so there is a little error introduced.</note> |
| 48 | </refsect1> |
| 49 | |
| 50 | <refsect1> |
| 51 | <title>Examples</title> |
| 52 | <para> |
| 53 | Here is an example of the arduinoReadF opcode. It uses the file <ulink url="examples/arduinoReadF.csd"><citetitle>arduinoReadF.csd</citetitle></ulink>. |
| 54 | <example> |
| 55 | <title>Example of the arduinoReadF opcode.</title> |
| 56 | <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> |
| 57 | <xi:include href="examples-xml/arduinoReadF.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 58 | </example> |
| 59 | </para> |
| 60 | </refsect1> |
| 61 | |
| 62 | <refsect1> |
| 63 | <title>See Also</title> |
| 64 | <para><link linkend="nonMIDIdevices"><citetitle>non-MIDI Devices</citetitle></link></para> |
| 65 | <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> |
| 66 | </refsect1> |
| 67 | |
| 68 | <refsect1> |
| 69 | <title>Credits</title> |
| 70 | <para> |
| 71 | <simplelist> |
| 72 | <member>Author: &namejohn;</member> |
| 73 | <member>Author: Richard Boulanger</member> |
| 74 | <member>2020</member> |
| 75 | </simplelist> |
| 76 | </para> |
| 77 | <para>New in version 6.15</para> |
| 78 | </refsect1> |
| 79 | </refentry> |