Basics of using pduino with pure data
Hi,
I am totally new to both arduino and pure data, so please be patient
I have pduino installed and can now create the [arduino] object in Pure Data.
Now, what do I do with this in Pure Data?
Basically, I understand the bits and pieces, but am missing an overall guide to help me understand how they all come together. Is there a book or comprehensive online source that can take me step-by-step through using the [arduino] object in pure data?
Examples I have found on the web so far seem very sparse and cryptic.
Let's say I wanted to use an optical sensor via arduino to control a parameter in Pd via pduino?
Do I use the [arduino] object to spit a value into a [number] object and use that as the input value for another object?
Thanks to all in advance for responding
Pduino-based multi-arduino wireless personal midi controller network
I am trying to find out if and how to create an arduino fio/xbee based wireless network of multiple fio/xbee's? 4 to be exact.
I am currently building a wireless system consisting of 2 "hand units", a wireless mouth interface and a base station xbee interfacing with pure data. www.beatjazz.blogspot.com. i already have the first fio/xbee communicating with the base station and pure data using pduino and all is perfect. this weekend i pick up the other 2 arduinos and fio's. all 3 arduinos need to connect with the pure data at the same time.
the instrument i am building is a wind midi controller except that instead of it being one horn like instrument, allthe left hand keys are in a wireless unit attached to the left hand and same goes for the right hand. the mouthpiece is worn like a headset microphone and is a pressure transducer for breath and a FSR for lip pressure. they must all work together as if one instrument. most of the coding has been done, andnow is time to split that code to the multiple wireless nodes.
it would seem that since all the xbee's have their own id's that that would translate over to the arduinos they are connected with and the whole network should come into the computer thru one serial port, which should solve that problem. I am wondering; how i might interface the 3 arduinos to pure data/pduino? theoretically, shouldnt i be able to name instances of the [arduino] object, say [arduino left], [arduino right], and [arduino mouth] so that each fio has its own instance? if so, how do i recognize the individual fio's and make use of their individual id's if that is the case at all?
Thank you in advance for any insight anyone might share.
Onyx
Animata / eyesweb / MAC
Hi kinolab, here interesting news for you:
As a gift for the beginning of 2011, there's a new "unstable" version
of OpenNI & Sensor modules with MacOSX support!
Other new features:
* Added support for multiple sensors.
* Improved README! (much more detailed instructions...)
* Some bug fixes...
Previous version features:
* A brand new .NET wrapper and .NET samples (OpenNI.net).
NITE binaries for all supported platforms (including MacOSX) will also
be released very soon.
The source code is located at:
https://github.com/OpenNI/OpenNI/tree/unstable
https://github.com/PrimeSense/Sensor/tree/unstable
GitHub:
git clone https://github.com/OpenNI/OpenNI.git -b unstable
git clone https://github.com/PrimeSense/Sensor.git -b unstable
Binaries:
Windows:
http://openni.org/sites/default/files/unstable/OpenNI-Bin-Win32-v1.0....
http://downloads.primesense.com/unstable/Sensor-Bin-Win32-v5.0.0.25.exe
Ubuntu 10.10 x86:
http://openni.org/sites/default/files/unstable/OpenNI-Bin-Linux32-v1....
http://downloads.primesense.com/unstable/Sensor-Bin-Linux32-v5.0.0.25...
Ubuntu 10.10 x64:
http://openni.org/sites/default/files/unstable/OpenNI-Bin-Linux64-v1....
http://downloads.primesense.com/unstable/Sensor-Bin-Linux64-v5.0.0.25...
MacOSX 10.6:
http://openni.org/sites/default/files/unstable/OpenNI-Bin-MacOSX-v1.0...
http://downloads.primesense.com/unstable/Sensor-Bin-MacOSX-v5.0.0.25....
We're really amazed from the awesome response of the community!
And thanks for everyone that's helped.
Ziv.
Arduino, ultrasonics and Pd: HELP needed for degree project!
Dear Pd'ers… I'm fairly new to Pd and have been using it during my 'Audio Production' degree at SAE college in London. I'm here to ask for help on my final degree project, which aims to control objects within Pd by way of proximity sensors connected to Arduino.
I have had moderate success, first using a Sharp GPD12 IR sensor connected to an analog port on an Arduino Diecimila, then a Devantech SRF02 connected via I2C to Arduino. I have managed to get Pure Data reading the sensor values using the Pure Data example included in SimpleMessageSystem (http://www.arduino.cc/playground/uploads/Code/SimpleMessageSystem.zip)... and only altering the number of the comport the Arduino appears on.
On the Arduino end, I have added the SimpleMessageSystem library, and am using the following sketch to run one or both of the sensors depending on whether or not I omit the SRF02 or GPD12 parts of the code.
// top //
#include <Wire.h>
#include <Servo.h>
#include <SimpleMessageSystem.h>
int sensorPin = 0;
int sensorValue = 0;
Servo servo1;
#define sensorAddress 0x70
#define readInches 0x50
#define readCentimeters 0x51
#define readMicroseconds 0x52
#define resultRegister 0x02
void setup()
{
Wire.begin();
Serial.begin(9600);
}
void sendCommand (int address, int command) {
Wire.beginTransmission(address);
Wire.send(0x00);
Wire.send(command);
Wire.endTransmission();
}
void setRegister(int address, int thisRegister) {
Wire.beginTransmission(address);
Wire.send(thisRegister);
Wire.endTransmission();
}
int readData(int address, int numBytes) {
int result = 0;
Wire.requestFrom(address, numBytes);
while (Wire.available() < 2 );{
}
result = Wire.receive() * 256;
result = result + Wire.receive();
return result;
}
void loop()
{
// SRF02 READING //
sendCommand(sensorAddress, readInches);
delay(70);
setRegister(sensorAddress, resultRegister);
int sensorReading = readData(sensorAddress, 2);
Serial.println(sensorReading);
delay (200);
// GPD12 READING //
sensorValue = analogRead(sensorPin);
int range = (6787 / sensorValue);
Serial.println(range);
delay(200);
}
// bottom //
Pure data is picking up the sensor's output as a decimal number, through the serial port, correctly, and showing this as a number in the SPECIAL CHARACTER section of the Pd patch, which I can then use to control various Pd parameters, like a slider for example.
If printing both sensor readings to the serial, the Pd patch will pick up the two sensor values alternately, but there seems no way of differentiating the two sensors within Pd, as they both come through the serial. I have tried prepending the serial print at the Arduino stage with a tag such as "IR" or "UL" for each sensor, but this simply ends up in nothing coming through in Pd.
Using one sensor gives the ability to control parameters with a fairly narrow detection range, but for the final version I would like to incorporate 4 or 5 sensors in order that I can cover nearly a full 360 degree range.
After a bit of research I have gone and bought 4 x Maxsonar EZ0's. They've got a wider range than the Devantech sensors, and can operate via I2C, serial or PWM. A number of people online seem to mention the improved stability when operating via PWM, so I thought this could be kinda useful.
I am going to London Hackspace tomorrow to get help with wiring up the sensors to my Arduino Diecimila, but for now, my main problem seems to be how to achieve greater communication between Pure Data and the sensors. It's all very good and well being able to take the decimal readout from an analog input to give one set of values in Pd, but I would like to know how to either to read (and trigger) each sensor discretely via PWM, or to somehow differentiate between each sensor's analog output, so that I can have the different sensors controlling different objects within Pd.
As well as SimpleMessageSystem, I looked at using the Pduino object. But to be honest, it is either not working properly (I have noticed reported issues with bugginess), or I am being stupid, as it has totally boggled my brain. In theory though, it seems like it should be able to do what I want, ie. send and receive commands between Arduino and Pd.
****************************************
So…. my questions for anyone out there with a knowledge of using Arduino + multiple sensors (preferably Maxsonar EZ's) with Pd are:
What is most appropriate for my project?
- Simple Message System or Pduino?
- analog or PWM?
And how do I get proper communication between the two platforms so I can discern discrete values from each sensor?
I'd really like to get a discussion going with this as (a) it would really help me in my degree (which ends in about 4 weeks!!!) and (b) I really want to share what I am doing, especially as the discussions on Arduino/Pd communication on the various forums seem a little patchy (at least for noobs like me). I also hope to continue my research in the future, sharing any findings I make with the community…
****************************************
PS. In the sharing spirit, please check out the Radio Tuner patch I've just posted over on the patch section of this forum - it's my first successful attempt at Pd... I hope you enjoy
Inverting a analog sensor value
Hi All
I am very new to Pure Data and Arduino so please excuse my simple questions but any help would be greatly appreciated.
I have a stretch sensor plugged into the analog inputs of the Arduino that decreases it's resistance when it is stretched.
What I need to do is invert the sensor value so instead of having a reducing number when I stretch the sensor the value is increased.
I know how to write this in as3 or processing with a formula like (sensorValue = MaxValue-sensorValue) but I cannot work out how to do this in PD.
The maximum value, when the sensor is not stretched, is 66 and reduces down to 33 when stretched
Any ideas.
Much appreciated.
Sean
Questions about "homemade" sensors
Hi!
I want to make my own DJ-program and controller. I have made one in Max/MSP before and thought I'd try PD (Pure Data) this time. I think I can manage that, but the controller will be harder. I want to make it as much from scratch as I can, using homemade sensors and sensor-interfaces from gamepads or something like that. I want them to use OSC to communicate with PD. For starters I want to have buttons (cue/play), sliders (the speed/pitch of the song) and something that rotates without start- or stop-points (also speed/pitch of sound (when spinning this forward the speed goes up, when spinning it backward the speed goes down), adjusting cue-points, and, maybe later, scratching). I know that homemade sensors are unstable and deteriorate with time, but hope I can learn more about this and maybe find information about materials that don't deteriorate as much or how to make them not deteriorate. Can someone point me in the right direction here? Maybe to a better forum for these types of things? Or to some kind of tutorial or guide? I have searched the internet and this forum, without finding anything.
If I can't use homemade sensors, I wonder where I can find the types of sensors I need and maybe if it would be better to use Phidgets or Arduino or something like that. And in that case – what things like that? Can I just buy slider/fader from some kind of electronics-store and connect it to a sensor-interface I made from a gamepad? Do I need to calibrate something? How do I find information about these things? Can you recommend specific sensors or stores?
The goal is to spend as little money as possible, but it has to be possible for me to be able to build this within “reasonable” time and without spending much time practicing and reading.
Thank you!
Bluetooth port problem using pd + arduino
Hello,
I've been using a Mac Mini running pd-extended and two arduino boards attached to it to control some electric motors of an installation. I use Pduino and the StandardFirmata uploaded into arduino and I had no problems until I decided to do a file transfer from my MacBook into this Mac Mini using Bluetooth. I opened the Setup Bluetooth Device, I chose to open a connection to my computer and did the file transfer.
Unfortunatelly, when I opened the patch I've been working for several months, one of the two arduino boards was not working. The comand
[open 2<
|
[arduino]
started to cause an error message saying the port I was using was no longer of my arduino but the tty.Bluetooth port related to my MacBook. I turned off the Bluetooth Devices of both computer but the tty port related to that bluetooth transfer is still in "the place of" my arduino usb tty port.
Then I tryed all the possibilities: [open 0<, [open 1< and [open 4< to try to find the right tty port. The [open 3< is already in use by the other arduino board which fortunatelly is still working. When i tryed [open 5< I received the message that I could only use more than four ports on .
Do anyone no how to manage these tty ports? Can I erase the tty port related to the bluetooth transfer? Will that cause my arduino tty port to come back to the list in which pure data can access?
I'm a bit scared because the installation will be exposed in two weeks!
Thank you very much for your attention.
Skrako.
Interface between pd and arduino
Hi I'm new to both Arduino and pd and currently facing some problems controlling Arduino using pd.
Arduino: Arduino-0018
pd: pd-Extended
I've downloaded the latest Pduino-0.5beta8 and have copied the Firmata folder to Arduino for updating purpose as stated in most of the sites.
I've tried running the arduino-help.pd inside the Pduino folder to test the connection and it says cannot arduino 1.
Hope someone can help me, thanks..
Firmata on arduino pro mini
Hi all,
I have some trouble running firmata on the pro mini. Although the same patch runs fine on both my Duemilanove's.
Apparently firmata isn't entirely the same on these mini's. Although Since arduino 0017 I can connect and send data, it's not without errors. First of all
[arduino]_WARNING_currently_unsupported: 176
[arduino]_WARNING_currently_unsupported: 160
[arduino]_WARNING_currently_unsupported: 176
UNKNOWN_INPUT_COMMAND: 0 10263
UNKNOWN_INPUT_COMMAND: 8 12339
UNKNOWN_INPUT_COMMAND: 11 9710
Is what I see when I try to run the pd patch. lot's of those, thousands...
Another weird thing is that even though pin 13 is unconnected on the arduino, It's the only pin that seems to work. I really don't get it. Is there some sort of different mapping? normally only pin 9-10-11 are supposed to work.
yet another thing id that PD becomes very unresponsive (waiting for serial data??) is this normal behavior if the firmata is buggy or something?
any ideas anyone?
Pduino + digital in? - Ping))))
The Parallax Ping Ultrasonic sensors require a special firmware to use them. You won't get any data from them using just a digital in or analog in. If you want a very easy to use ultrasonic sensor, I recommend the Maxbotix ones. They output an analog signal, here's one of them:
http://www.sparkfun.com/commerce/product_info.php?products_id=639
To use the Parallax sensor, basically, you can get the Parallex Arduino firmware from the Arduino forums, then use the Arduino Firmata library to set up the communications.