|
ArduinoI was able to use the Serial IO patch with my Arduino (http://www.arduino.cc/) to send a string to it and control an LED on/off, but I wasn't able to use the analog output to control the intensity of the light. So that got me thinking that maybe you could make an Arduino patch that would make it easy to work with it from QC. I think that your best bet would be to use the Firmata firmware. |
How does it fail? Maybe it's a design flaw/implementation flaw in the Serial patch?
I'm a bit hesitant to commit to making another patch I cannot test (no Arduino available around here), but I think it would make things simpler overall, if done well.
how protocol-compatible are the different firmwares? (I know next to nothing about these, except for what I've briefly read on the website)
I don't really know about the protocols. I'm just a beginner with Arduino and wanted to see if I could use it with QC. I got this example working http://www.arduino.cc/en/Tutorial/PhysicalPixel with the serial patch but this one didn't http://www.arduino.cc/en/Tutorial/Dimmer
Here is the code in Arduino:
In QC I'm just using a input splitter for the Data source and an LFO is connected to the Send Signal. It's definitely connecting with the Arduino board, but the LED is not affected by the data.
I guess the issue is that the serial patch only sends strings and the analog out in Arduino uses bytes. There might be some really simple solution for this, but I'm not smart enough to figure it out.
After looking over the code a bit, I'm pretty sure you're right; it's a matter of sending bytes vs. strings (which are also bytes, but not as directly accessible as such).
So, it looks like we're in need of some binary data manipulation tools. Any ideas on how this should be implemented to be useful? We could add some index inputs to the serial sender to send raw bytes with a specified value, but that would be cumbersome for lots of data. An alternative would be to make a Binary Data port type (this has been discussed very limitedly, perhaps it's time for a full-blown discussion?).
I'm up for ideas; This doesn't look too difficult to solve, and would open up a lot of additional possibilities (DMX would use this too, in the very near future)
I'll try this at some point, since I have an Arduino I use in a custom VJ controller. Any chance you could make your QC patch available online?
I just built a midi out for the Arduino (about three components) and route it in through a midi interface, but midi is restricted to 7 bit controller values (0-127), and the ADC in the Arduino can read 10 bits (0-1024), so if we could get this to work I'd consider moving to serial.
firmata is imho definitely the way to go for an arduino node. it exposes all the i/o functionality of the arduino to the host software. just a bitch none of the existing hosts fit with qc.
i'll be willing to help code this if i have a proper project that actually requires the arduino.
toby
heya, Any more developments on the quartz to firmata front??? I am VERY interested. Im working on a cool project right now to create a 3D interface for moving models around in quartz.
Please oh please oh please Can some one help me with an Arduino to Quartz Composer patch? I cant find the Kineme serial patch anywhere on this site! Anyone know where to find it?
The serial patch is still in beta (because everyone has a different experience with it, and I don't know why) so to access it you'll need to check the "I would like to beta test new and updated patches." box in your user profile. Then, head over to http://kineme.net/SerialIOPatch20080319beta
Hi also want to second this feature request. Would be great if we can make QC become connected to the outside of the PC environment either via Arduino or also via phidgets :-))
The Serial IO Beta patch works very well for Arduino analog and digital input (sensors, buttons etc.) You can download an example here http://mansteri.com/2008/11/arduino-quartz-composer/
Only the output (servos, LEDs etc.) is problematic. Apparently there are some problems with the FTDI drivers. You can read all about it on the Serial IO discussion. It's very weird, because the first time I used it on this computer, I was able to get it working (turning an LED on/off with the keyboard), but then it suddenly stopped working and I haven't been able to use it at all after that. Even with the exact same code I used before.
Hey All,
I've been trying to get this to work as well. Downloaded the latest FTDI drivers, etc. I can get all the inputs working fine, but no luck with sending.
My arduino code is below. As you can see, it should turn the LED on if it gets ANYTHING from from the serial connection. But, using the SerialIO patch in QC won't get it to signal.
I've put the Firmata code on the arduino, and tested it with Processing; which works great on ALL in's and outs. But, can't get the SerialIO to send.
I've read all about the binary/javascript issues, and have tried some things with this, but a simple example with working QC/SerialIO would be really helpful.
Anyone have an example? Or, even better, an example QC patch that uses the Firmata code?
Thanks, Cj
Try this one. It is a simple QC with two serial output patches (and a sprite for feedback). Paste the included code in your arduino and start the serial monitor just to make sure the thing is running. In QC push the up/down arrows of your keyboard to turn on/off the LED on your arduino.
Somehow QC sends signal. Try also deleting the second SerialI/O patch and pasting it again.
I can't say the thing actually "works" as it should but there is signal passing by.
Tip: in the arduino serial monitor send '1' or '0' to wake up the communication. You may simply send an initial value before the loop.
Juan
I've got this working, but only after a quit and restart of QC. If you stop and start the composition it only works the very first time it seems...
It also only works when the serial monitor from the arduino app is active, and with one send patch it still works as well.
I just got a serial plugin working that is more reliable than the kineme serial out. I modified this one http://www.planetclegg.com/projects/QC-Peggy.html
It seems to work pretty nicely when sending single characters to Arduino. I still need to polish it a bit before releasing it out there, but email me if you need the plugin.
m at mansteri dot com
Oh well, I was celebrating too early. It seems that I'm also running into the same issue as the Kineme Serial Output patch.
from here: http://kineme.net/SerialIOPatch20080326beta
My plugin works quite well as long as you also have a Serial Input Patch connected somewhere in your composition.
It does fix the strange issues with the Kineme Serial Output where you would have to open the Arduino serial monitor to get the patch to output anything. You can also start and stop the composition and the patch should still work.
Here's the download link if someone's interested: http://mansteri.com/download/software/serial/MonsteriSerialOutBeta.zip
Thanks a lot. It works here and I can shutdown the arduino app as well. I was getting used to push-start the patch from the serial monitor ! (still doesn't survive if I stop the viewer but it is a lot more responsive)
update: It actually does survive the stop/start but I noticed the arduino app should be off. So... upload the code, quit the app and start QC. then it works.
juan
ohh sweet waxtastic i'm working on a xbee project and was going to try and incorporate qc somehow, maybe as multipoint aggregate or visual interface for xbee. when i get to the visual part i will give your plug a try.
Is it right, that your plugin just sends the ASCII code of the first digit or letter used in "Data" ?
that's right. so not really useful for everything. I never had the time to work any more on this as I only needed to send single characters.