3
\$\begingroup\$

I've been trying to find ways to pass a variable from my Arduino code into PureData in real-time. I've explored PDuino and the Firmata library, but the tools seemed a bit more for reading and controlling pins. Maybe I glanced over how do get variable data.

If you have done something like this, could you briefly explain the process being utilized here? I don't fully understand the connections being made or how Firmata is mediating things. If you have a suggestion for a library or simple code, please let me know.

\$\endgroup\$
  • 1
    \$\begingroup\$ Is there any electrical engineering aspect in this question? \$\endgroup\$ – Wouter van Ooijen Feb 14 '14 at 9:24
  • 1
    \$\begingroup\$ This question appears to be off-topic because it is about programming. StackOverflow would be a better place for it. \$\endgroup\$ – Dave Tweed Feb 14 '14 at 12:23
3
\$\begingroup\$

I don't fully understand the connections being made or how Firmata is mediating things.

It seems to me that the Firmata sketch makes your arduino into a dumb peripheral of your PC.

If I am right, when running Firmata, you don't have other code running on the Arduino. Therefore you don't have any variables in an Arduino sketch that you need access to.

The Firmata library and Firmata sketch handle the communications for you. You only interface with the library on your PC

You do all the processing you want to do in your PC using a language with a Firmata library.

pass a variable from my Arduino code into PureData in real-time

In this case, you are writing two programs, a sketch that runs on an Arduino and a PureData program that runs on a PC. You want the two programs to communicate in real-time.

Use an appropriate communications method. If your PureData program is running on a PC and the PC is connected to the Arduino by a USB cable, you can use serial communications. The Arduino has a serial library and I would hope PureData has a way of reading and writing to COM ports.

The PureData community ought to (and probably do?) have a support forum with example code for this sort of task.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.