Hey
Working on a project, using four pads (comprised each of a capacitive sensor on top of an fsr) interfacing with a PD granular sampler patch. I'm using an Arduino Genuino Uno and Capsense library to handle the capacitive sensors, writing them to USB serial, and the analog ins of the Bela Mini for the FSRs.
The FSRs are fine since they can be directly called from the PD patch (adc~ 3-6), however I'm having trouble figuring out how to get the data from Arduino's Serial to Bela and PD. The data from Arduino is 4 separate floats also.
Does anyone have a template cpp for receiving Serial USB data to bela/a PD patch? Or can offer any guidance on achieving this?
(Sorry if this is a dumb question, I'm new to C++/bela)
USB serial
I have recently added a Serial
library to Bela. Here is the source code and here is an example that uses it. You could just copy these files to your project, or update your whole board to the dev
branch to use them. If this works as a first step for you to read Arduino data on Bela, then I can show you how to integrate it within a Pd example.