This example shows how a single sensor can be streamed via serial data from the Arduino to SuperCollider.
The breadboard circuit is the same as in the first Arduino sensor example:
For the SC example, serial data is sent in a simple way. The additional scaling is optional, but makes it easier to process the data in SuperCollider.
On Linux, the Arduino's serial interface can be found in the terminal:
On the SC receiver end, a serial port object is initialized with the matching serial interface:
A control rate bus is used to visualize the received data and make it accessible to other nodes:
The actual receiving and decoding of the data happens inside a routine with an infinite loop. It appends incoming characters, until a return character (13) is received. In this case, the assembled string is converted to a Float and written to the sensor bus:
The SuperCollider Tutorial by Eli Fieldsteel shows a similar solution for getting Arduino sensors into SuperCollider via USB.
Create a synth node with a parameter mapped to the sensor bus.