Using pduino and Firmata to read values from the Grove I2C Touch sensor
Hi @alexandros Yep you were right, the header file needed lower-case! Thank you so much my sensor is now working with the mods to the sketch as well as using your PD abstractions.
.. Is there a way to use your abstractions with the Firmata sketch to control this Grove i2C touch sensor? Reason being, I need to teach some of my students this environment and I think it would be good for them (if possible) to use the standard Firmata with all sensors (including I2c) to missing out the ardunio coding aspect and just interact with the data in Pd using your abstractions? I'm not get with arduino code myself so having firmata "solve that problem" would be a good starting place for now. Is it possible to use Firmata with your abstractions?
all the ebst
Casper
Swept sine deconvolution
Hello Katjav,
The new patch is great, it works well and already does more than I was expected to reach in such a small amount of time.
I would like to do some tests and comparison with a commercial software with the same functionality but I have just realised that the laptop with the software installed is not available until monday; nevermind.
I have two questions on the patch:
-
there is a strange behaviour in PD, if i turn on dsp the patch doesn't allow me to move the horizontal slides or better it doesn't visualize the movements while with dsp off there is no problem. It is a bit of a problem as you don't see the computation progress slider moving.
Do you know why?
No error messages and the last PD installed. -
would you please expand a bit more about weighted amplitude normalisation?
in the case of IRs normalising the main peak of the file will make all the IR information readable, or probably I am missing the point here.
so regarding the to-do list:
-
Multichannel: it is quite important it could be multichannel input (i.e. ambisonic mic or stereo pairs) while it is much less important as multichannel output (1 signal would be common to all speakers you are testing, no need for different signal).
-
fft analysis of IR: great idea but would be great to derive also additional acoustic parameters, I will provide maths for all the parameters we need to implement (ISO 3382 part 1 and part2, sorry I need to send the papers privately as I would get in trouble if I share on the web).
Also I would like to add in the future, a-format to b-format encoding (http://pcfarina.eng.unipr.it/Public/B-format/A2B-conversion/A2B.htm).
This is why 4 capsules tetrahedral mics can be used to analyse 3D soundscapes including directional analysis (along 3 axes) and understand issues in room such as room modes directions, flutter echoes and first reflections direction among others.
I am glad you have done a clean-up of the scaling constant calculation as in the previous patch it was a bit confusing to me.
I will have a more in depth play around tomorrow or friday...i am also in the middle of moving house...:(
Thank you
Bassik
Firmata test
there is someone that know why the firmata test in:
http://www.pjrc.com/tmp/firmata/readme.html
are not showing me the test , its only download the application with out the test!
if somebody know something
or having a firmata test more new .
thanks alot
PD -\> Firmata 2.1 -\> ShiftOUT
Welcome comunity,
I am starting my electronics adventure and I have built a led matrix controler based on shift register like the one here:
http://arduino.cc/en/Reference/ShiftOut
It is working fine, but to make things more complex I'd like to control the matrix from PD using Firmata 2.1 which seems to have now control of ShiftOUT as mentioned here:
http://firmata.org/wiki/Proposals#ShiftOut
I am trying to send proper data to firmata from pduino examples with no luck.
I do not know how to understand this:
/* shiftIn/Out (uses 8-bit value)
* ------------------------------
* 0 START_SYSEX (0xF0)
* 1 shiftOut (0x75)
* 2 dataPin (0-127)
* 3 clockPin (0-127)
* 4 latchPin (0-127)
* 5 msbFirst (boolean)
* 6 bits 0-6 (least significant byte)
* 7 bit 7 (most significant bit)
* n ... (as many byte pairs as needed)
* n+1 END_SYSEX (0xF7)
*/
what should I send is something like: sysex 0xF0 0x75 9 10 11 ?? ?? ?? ?? 0xF7
too much question marks here....
pduino seems also not to understand hex values I am putting...
Please advice
Message formatting
hello.
I'm using PD for controlling SuperCollider Synths via OSC and having trouble on how to format SC messages in PD format.
I encounter object like 'sprintf' and honestly do not understand very well.
I have some SC syntax like,
a = Synth(\dyn, [\freqs, Array.rand(8, 100, 200), \out,102])
and
error: sendOSC: no method for 'sprintf'
error: sendOSC: no method for '['freqs''
error: sendOSC: no method for 'Array.rand(8'
error: sendOSC: no method for 'float'
error: sendOSC: no method for '200)])'
sprintf's error: an object created without valid format patterns...
sprintf's error: an object created without valid format patterns...
Is there a comprehensive documentation on formatting messages in PD?
how they interpret things like "[" or commas and stuff.
I just need to make bunch of message boxes with SC command to send over PD's sendOSC object. it helps me not to type this things in SC but just click it in PD.
but I have no idea on how sendOSC will interpret strings and intergers, commas, semi-colones...etc.
'will be much appriciated.
thank you.
2 signals as 1
i have some basic problems with pd
i connect pd with arduino and a sensor. the sensor sends signals to pd and they trigger other reactions.
the problem is:
1. when a box is checked, it means it receives a signal. when unchecked, it regards that as another signals. then how to treat 2 signals as 1? it is "x" and "o". does pd automatically treat those signals as 0 and 1? if yes, then 0=checked/ x , or 1=checked/x ?
2. i tried to use simple digital firmata for arduino, but it does not show any signs of firmata on pd canvas. is that normal? or should i see the name of hte firmata on canvas? btw, i marked a small red canvas there as i have seen some ppl have their firmata shown on canvas. but not mine.
thanks
Errors on compiling
Hi,
I'm totally new at this. I'm trying to upload some examples to my arduino to use with PD. However when compiling I get a error... it's strange because the sketch is original from the Pduino examples.
sketch:
/* Supports as many analog inputs and analog PWM outputs as possible.
*
* This example code is in the public domain.
*/
#include <Firmata.h>byte analogPin;
void analogWriteCallback(byte pin, int value)
{
pinMode(pin,OUTPUT);
analogWrite(pin, value);
}void [b]setup[/b]()
{
Firmata.setFirmwareVersion(0, 1);
Firmata.attach(ANALOG_MESSAGE, analogWriteCallback);
Firmata.begin();
}void [b]loop[/b]()
{
while(Firmata.available()) {
Firmata.processInput();
}
for(analogPin = 0; analogPin < TOTAL_ANALOG_PINS; analogPin++) {
Firmata.sendAnalog(analogPin, analogRead(analogPin));
}}
Error
hardware\libraries\Firmata/Firmata.h:61: error: typedef 'callbackFunction' is initialized (use __typeof__ instead)
hardware\libraries\Firmata/Firmata.h:61: error: 'byte' was not declared in this scope
hardware\libraries\Firmata/Firmata.h:61: error: expected primary-expression before 'int'
hardware\libraries\Firmata/Firmata.h:64: error: typedef 'sysexCallbackFunction' is initialized (use __typeof__ instead)
hardware\libraries\Firmata/Firmata.h:64: error: 'byte' was not declared in this scope
(much longer ...... but always the same)
In function 'void setup()':
Can u tell me how can I solve this error?
Thanks in advance
Call for participation: LIWOLI09
Sorry for ><, please >>
--
Liwoli 2009
hacklab for art and open source
23 - 25 April 2009 - Kunstuniversität Linz
--
Liwoli 2009 is a three day long Hacklab and an open invitation to all
who would like to participate in an active process of learning,
producing and sharing around the areas of Free/Libre Open Source
Software and Art. FLOSS developers, artists and programmers such as the
collective GOTO10 or activists from HAIP (Hack Act Interact Progress)
and many others form the basis for the event and share their knowledge
in the form of workshops, hacklabs, presentations, installations and
performances.
--
Please register NOW to book a place in some of the many FREE workshops!
http://linz.linuxwochen.at/en/programm/format/2009/Workshop
- Select a workshop
- Read the description
- Interested? Click on "Register" and fill the form
DEADLINE FOR REGISTRATION: 15/04/09
--
... and do not miss out on the rest of the event!
http://linz.linuxwochen.at/en/programm/format/2009/Vortrag
http://linz.linuxwochen.at/en/programm/format/2009/Presentation
http://linz.linuxwochen.at/en/programm/format/2009/Performance
http://linz.linuxwochen.at/en/programm/format/2009/Interviews
http://linz.linuxwochen.at/en/programm/format/2009/Intervention
http://linz.linuxwochen.at/en/programm/format/2009/Installation
With the participation of:
Andrea Mayr, Andreas Trawoeger, Arjan Scherpenisse, Aymeric Mansoux,
Christoph Haag, Claude Heiland-Allen, Dan Wilcox, Daniel Turing
David Ayers, Eleonora Oreggia, Georg Jakob, Holger Schöner,
Jan-Kees van Kampen, Johannes Kreidler, Marius Shebella,
Pippa Buchanan, Ricardo Palmieri, Rob Canning, Robert Martin,
Roch Forowitz, Sascha Neudeck, StÃ(c)phanie Vilayphiou, Thomas Warwaris,
Yves Degoyon, ... and more to be confirmed!...
--
Questions?
http://linz.linuxwochen.at/en/contact
Where to sleep?
http://linz.linuxwochen.at/content/service
--
:*
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()':
Networked Audio problems
I am trying to get either netsend~ or streamout~ to work. So far neither of them are working with their respective receive objects.
with netsend~ we're getting weird errors like sending too many channels, when we set it to 2. the error would say sending 47 channels or some other false information.
okay so here is the process
[format 8bit<
[connect xxx.xxx.xxx.xxx 8000<
compute audio
then on the receive side its says connected.
[env~] is reporting "nan"
then the boot
netsend~: send tag: software caused connection abort (10053)
with [streamout~] its reporting large numbers on the streamin side. Below is an example.
unknown format 0
unknown format 0
unknown format 0
unknown format 0
error: streamin~: got an invalid frame size of -large number, maximum is 256
[streamin~] is set with [reset 4<
any ideas, I would rather get netsend~ working as you can seemingly do multiple channels.