Arduino and pure data
Hello. I'm trying to use Arduino with Puredata using the Firmata Library. I downloaded Firmata and installed the library as instructed in the readme, and then loaded 'AnalogFirmata' from the library examples. When I try to compile this example (or any of the others) I receive a string of error statements. Code and errors listed below. Any suggestions?
Code:
/* This firmware supports as many analog ports as possible, all analog inputs,
* four PWM outputs, and two with servo support.
*
* This example code is in the public domain.
*/
#include <Firmata.h>
#include <Servo.h>
/*==============================================================================
* GLOBAL VARIABLES
*============================================================================*/
/* servos */
Servo servo9, servo10; // one instance per pin
/* analog inputs */
int analogInputsToReport = 0; // bitwise array to store pin reporting
int analogPin = 0; // counter for reading analog pins
/* timer variables */
extern volatile unsigned long timer0_overflow_count; // timer0 from wiring.c
unsigned long nextExecuteTime; // for comparison with timer0_overflow_count
/*==============================================================================
* FUNCTIONS
*============================================================================*/
void analogWriteCallback(byte pin, int value)
{
switch(pin) {
case 9: servo9.write(value); break;
case 10: servo10.write(value); break;
case 3:
case 5:
case 6:
case 11: // PWM pins
analogWrite(pin, value);
break;
}
}
// -----------------------------------------------------------------------------
// sets bits in a bit array (int) to toggle the reporting of the analogIns
void reportAnalogCallback(byte pin, int value)
{
if(value == 0) {
analogInputsToReport = analogInputsToReport &~ (1 << pin);
}
else { // everything but 0 enables reporting of that pin
analogInputsToReport = analogInputsToReport | (1 << pin);
}
// TODO: save status to EEPROM here, if changed
}
/*==============================================================================
* SETUP()
*============================================================================*/
void setup()
{
Firmata.setFirmwareVersion(0, 2);
Firmata.attach(ANALOG_MESSAGE, analogWriteCallback);
Firmata.attach(REPORT_ANALOG, reportAnalogCallback);
servo9.attach(9);
servo10.attach(10);
Firmata.begin();
}
/*==============================================================================
* LOOP()
*============================================================================*/
void loop()
{
while(Firmata.available())
Firmata.processInput();
if(timer0_overflow_count > nextExecuteTime) {
nextExecuteTime = timer0_overflow_count + 19; // run this every 20ms
for(analogPin=0;analogPin<TOTAL_ANALOG_PINS;analogPin++) {
if( analogInputsToReport & (1 << analogPin) )
Firmata.sendAnalog(analogPin, analogRead(analogPin));
}
}
}
Error Statements:
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:61: error: typedef 'callbackFunction' is initialized (use __typeof__ instead)
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:61: error: 'byte' was not declared in this scope
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:61: error: expected primary-expression before 'int'
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:64: error: typedef 'sysexCallbackFunction' is initialized (use __typeof__ instead)
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:64: error: 'byte' was not declared in this scope
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:64: error: 'byte' was not declared in this scope
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:64: error: 'byte' was not declared in this scope
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:64: error: 'argv' was not declared in this scope
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:81: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:81: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:86: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:87: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:88: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:90: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:91: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:91: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:91: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:95: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:95: error: 'callbackFunction' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:96: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:97: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:98: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:98: error: 'sysexCallbackFunction' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:98: error: 'void FirmataClass::attach(int, int)' cannot be overloaded
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:95: error: with 'void FirmataClass::attach(int, int)'
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:99: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:104: error: 'byte' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:105: error: ISO C++ forbids declaration of 'byte' with no type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:105: error: expected ';' before '*' token
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:107: error: 'byte' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:108: error: 'byte' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:109: error: 'byte' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:110: error: 'byte' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:112: error: 'boolean' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:115: error: 'callbackFunction' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:116: error: 'callbackFunction' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:117: error: 'callbackFunction' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:118: error: 'callbackFunction' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:119: error: 'callbackFunction' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:122: error: 'sysexCallbackFunction' does not name a type
In function 'void setup()':
Interfacing PD with the Arduino ... how?
i got a problem in uploading the file to the board. ( I have press play, same error found. When I press upload to I/O, below error found)
anyone can help?
thx
////////////////////////////
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:61: error: typedef 'callbackFunction' is initialized (use __typeof__ instead)
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:61: error: 'byte' was not declared in this scope
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:61: error: expected primary-expression before 'int'
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:64: error: typedef 'sysexCallbackFunction' is initialized (use __typeof__ instead)
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:64: error: 'byte' was not declared in this scope
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:64: error: 'byte' was not declared in this scope
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:64: error: 'byte' was not declared in this scope
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:64: error: 'argv' was not declared in this scope
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:81: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:81: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:86: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:87: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:88: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:90: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:91: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:91: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:91: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:95: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:95: error: 'callbackFunction' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:96: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:97: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:98: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:98: error: 'sysexCallbackFunction' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:98: error: 'void FirmataClass::attach(int, int)' cannot be overloaded
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:95: error: with 'void FirmataClass::attach(int, int)'
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:99: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:104: error: 'byte' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:105: error: ISO C++ forbids declaration of 'byte' with no type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:105: error: expected ';' before '*' token
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:107: error: 'byte' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:108: error: 'byte' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:109: error: 'byte' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:110: error: 'byte' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:112: error: 'boolean' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:115: error: 'callbackFunction' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:116: error: 'callbackFunction' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:117: error: 'callbackFunction' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:118: error: 'callbackFunction' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:119: error: 'callbackFunction' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:122: error: 'sysexCallbackFunction' does not name a type
In function 'void setup()':
Complete noob alert! (installation)
Well, despite the successful installation of X11, my list of what all Pd cannot load is even longer than arif's:
GEM: Graphics Environment for Multimedia
GEM: ver: 0.91.1 'tigital'
GEM: compiled: Jul 29 2008
GEM: maintained by IOhannes m zmoelnig
GEM: Authors : Mark Danks (original version)
GEM: Chris Clepper
GEM: James Tittle
GEM: IOhannes m zmoelnig
GEM: with help by Guenter Geiger, Daniel Heckenberg, Cyrille Henry, et al.
GEM: found a bug? miss a feature? please report it:
GEM: homepage http://gem.iem.at/
GEM: bug-tracker http://sourceforge.net/projects/pd-gem/
GEM: mailing-list http://lists.puredata.info/listinfo/gem-dev/
GEM: compiled for SIMD architecture: AltiVec
GEM: using AltiVec optimization
cyclone: can't load library
zexy: can't load library
creb: can't load library
cxc: can't load library
iemlib: can't load library
list-abs: can't load library
mapping: can't load library
markex: can't load library
maxlib: can't load library
memento: can't load library
mjlib: can't load library
motex: can't load library
oscx: can't load library
pddp: can't load library
pdogg: can't load library
pixeltango: can't load library
pmpd: can't load library
rradical: can't load library
sigpack: can't load library
smlib: can't load library
toxy: can't load library
unauthorized: can't load library
pan: can't load library
freeverb: can't load library
hcs: can't load library
jmmmp: can't load library
ext13: can't load library
hardware: can't load library
deprecated: can't load library
flatspace: can't load library
iem_anything: can't load library
xsample objects, version 0.3.2pre
xrecord~, xplay~, xgroove~
(C)2001-2007 Thomas Grill
ggee: can't load library
flib: can't load library
mrpeach: can't load library
PDP: pure data packet version 0.12.5-darcs
[pdp_qt]: setting LIBQUICKTIME_PLUGIN_DIR to:
/Applications/Pd-extended.app/Contents/lib/libquicktime
PiDiP : additional video processing objects for PDP
version 0.12.22 ( ydegoyon@free.fr )
pdp_colorgrid: version 0.4
by Yves Degoyon (ydegoyon@free.fr) & Lluis Gomez i Bigorda (lluis@artefacte.org)
I'm a bit clueless here:/
Cyclone: can't load library
I have this problem too on OSX. For OSX you can edit file org.puredata.pd.default.plist, which is in your Pd-extended package in your Applications folder, but it won't help anyway because there are no *.pd_darwin or *.d_ppc files in PD application package for OSX. Here is the cut from the startup log with verbose:
tried ./cyclone.d_ppc and failed
tried /Library/Pd/cyclone.d_ppc and failed
tried /System/Library/Fonts/cyclone.d_ppc and failed
tried /Library/Fonts/cyclone.d_ppc and failed
tried /Users/Alex/Library/Fonts/cyclone.d_ppc and failed
tried /usr/X11R6/lib/X11/fonts/TTF/cyclone.d_ppc and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/fonts/cyclone.d_ppc and failed
tried /sw/lib/X11/fonts/msttf/cyclone.d_ppc and failed
tried /sw/lib/X11/fonts/intl/TrueType/cyclone.d_ppc and failed
tried /sw/lib/X11/fonts/applettf/cyclone.d_ppc and failed
tried /Applications/Pd-extended.app/Contents/Resources/extra/cyclone.d_ppc and failed
tried ./cyclone.pd_darwin and failed
tried /Library/Pd/cyclone.pd_darwin and failed
tried /System/Library/Fonts/cyclone.pd_darwin and failed
tried /Library/Fonts/cyclone.pd_darwin and failed
tried /Users/Alex/Library/Fonts/cyclone.pd_darwin and failed
tried /usr/X11R6/lib/X11/fonts/TTF/cyclone.pd_darwin and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/fonts/cyclone.pd_darwin and failed
tried /sw/lib/X11/fonts/msttf/cyclone.pd_darwin and failed
tried /sw/lib/X11/fonts/intl/TrueType/cyclone.pd_darwin and failed
tried /sw/lib/X11/fonts/applettf/cyclone.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/extra/cyclone.pd_darwin and failed
tried ./cyclone/cyclone.d_ppc and failed
tried /Library/Pd/cyclone/cyclone.d_ppc and failed
tried /System/Library/Fonts/cyclone/cyclone.d_ppc and failed
tried /Library/Fonts/cyclone/cyclone.d_ppc and failed
tried /Users/Alex/Library/Fonts/cyclone/cyclone.d_ppc and failed
tried /usr/X11R6/lib/X11/fonts/TTF/cyclone/cyclone.d_ppc and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/fonts/cyclone/cyclone.d_ppc and failed
tried /sw/lib/X11/fonts/msttf/cyclone/cyclone.d_ppc and failed
tried /sw/lib/X11/fonts/intl/TrueType/cyclone/cyclone.d_ppc and failed
tried /sw/lib/X11/fonts/applettf/cyclone/cyclone.d_ppc and failed
tried /Applications/Pd-extended.app/Contents/Resources/extra/cyclone/cyclone.d_ppc and failed
tried ./cyclone/cyclone.pd_darwin and failed
tried /Library/Pd/cyclone/cyclone.pd_darwin and failed
tried /System/Library/Fonts/cyclone/cyclone.pd_darwin and failed
tried /Library/Fonts/cyclone/cyclone.pd_darwin and failed
tried /Users/Alex/Library/Fonts/cyclone/cyclone.pd_darwin and failed
tried /usr/X11R6/lib/X11/fonts/TTF/cyclone/cyclone.pd_darwin and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/fonts/cyclone/cyclone.pd_darwin and failed
tried /sw/lib/X11/fonts/msttf/cyclone/cyclone.pd_darwin and failed
tried /sw/lib/X11/fonts/intl/TrueType/cyclone/cyclone.pd_darwin and failed
tried /sw/lib/X11/fonts/applettf/cyclone/cyclone.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/extra/cyclone/cyclone.pd_darwin and failed
cyclone: can't load library
Help please!!!
So I am new to PD and am taking a class. I currently have an assignment due in a few days and I am trying to finish it. I have to design a patch with multiple subpatches that will do to things.
Layer 2 On this layer the sound will play at a normal speed/pitch and it will play every 10 seconds. Gradually, the periodicity of the repetition will start increasing and it will take 2 minutes to end up playing every 5 seconds. After that minute the processes will start again, over and over. In other words, there will be an accelerando in the repetition of the unmodified sound. 2 points Layer 3 On this layer the sound will play over and over but the speed/pitch will change randomly so sometimes the sound will play faster (up to a tenth of a second) and sometimes the sound will play slower (up to 10 seconds). When the file plays faster it will naturally play at a higher pitch, and when it plays slower it will play at a lower pitch. On each repetition the sound should play sometimes forward and sometimes backwards.
Any suggestions on how to do this would be I would like to recieve because I am really confused
Gridflow on agnula demudi ?
arrrrrgggg:
This is the GridFlow 0.8.0 configurator within Ruby version 1.8.2
[fast] Compile for speed (and not debuggability): enabled
[gcc3] GNU C++ Compiler 3: missing (undefined method `<' for nil:NilClass)
[stl] C++ Standard Template Library: missing (gcc compilation error)
[gcc64] GNU C++ in 64-bit mode: missing (gcc compilation error)
[libruby] Ruby as a dynamic library: missing (gcc compilation error)
[librubystatic] Ruby as a static library: missing (gcc compilation error)
[pentium] Pentium-compatible CPU: missing (gcc compilation error)
[mmx] MMX-compatible CPU (using NASM): disabled (would need pentium)
[simd] SIMD (MMX/SSE/Altivec) (using GCC): disabled (would need pentium)
[profiler] profiler (speed measurements): disabled (would need pentium)
[usb] USB Library: missing (where is usb.h ?)
[ieee1394] IEEE1394 Libraries for Linux (raw1394/dc1394): disabled (by author)
[x11] X11 Display Protocol: missing (where is X11/Xlib.h ?)
[x11_shm] X11 acceleration through shared memory: disabled (would need x11)
[sdl] Simple Directmedia Layer (experimental support): missing (where is SDL/SDL.h ?)
[objcpp] GNU/Apple ObjectiveC++ Compiler: missing (where is objc/Object.h ?)
[quartz] Apple Quartz/Cocoa Display: disabled (would need objcpp)
[aalib] Ascii Art Library: missing (where is aalib.h ?)
[jpeg] JPEG Library: missing (where is jpeglib.h ?)
[png] PNG Library <libpng12/png.h>: missing (where is libpng12/png.h ?)
[png] PNG Library <png.h>: missing (where is png.h ?)
[videodev] Video4linux Digitizer Driver Interface: missing (gcc compilation error)
[mpeg3] HeroineWarrior LibMPEG3 <libmpeg3/libmpeg3.h>: missing (where is libmpeg3/libmpeg3.h ?)
[mpeg3] HeroineWarrior LibMPEG3 <libmpeg3.h>: missing (where is libmpeg3.h ?)
[quicktimeapple] Apple's QuickTime: missing (gcc compilation error)
[quicktimehw] HeroineWarrior QuickTime4Linux (or LibQuickTime) (try #1): missing (gcc compilation error)
[quicktimehw] HeroineWarrior QuickTime4Linux (or LibQuickTime) (try #2): missing (gcc compilation error)
[xine] Xine movie decoder: disabled (by author)
[puredata] Miller Puckette's Pure Data: disabled (would need libruby or librubystatic)
generating ./config.make
generating config.h
creating Makefile
humm.... it will probably compile but seem will could do not much without jpeg png video4linux X11 etc....
will wait a .deb package...