hi
How to connect analog sensors sharp GP2Y0A21YK+ arduino uno + MaxMSP ?
Some wires between the sensor and the Arduino, and a USB cable from the Arduino to the PC.
which can I use the example in arduino software ? ( for max test analog freq ) and Is there a sample max msp patch ?
I don't know. Where have you looked? Did you try searching this site? Did you try google or bing or whatever search site you use?
Try here Arduino Playground - MaxMSP for a start.
i downloaded arduino 2 max but Error adding cod is pde on arduino software ( serial BYTE )
The error message is quite descriptive. Find the Serial.print() statement containing the BYTE keyword and replace it with a Serial.write() instead.
how can i Find the my Serial.print() ? sorry i beginner user
You could try Edit>Find... in the IDE, or you could just look for it.
my arduino max pde :
/*
- Arduino2Max
- Send pin values from Arduino to MAX/MSP
- Arduino2Max.pde
-
- This version: .5, November 29, 2010
-
- Copyleft: use as you like
- by Daniel Jolliffe
- Based on a sketch and patch by Thomas Ouellet Fredericks tof.danslchamp.org
*/
int x = 0; // a place to hold pin values
int ledpin = 13;
void setup()
{
Serial.begin(115200); // 115200 is the default Arduino Bluetooth speed
digitalWrite(13,HIGH); ///startup blink
delay(600);
digitalWrite(13,LOW);
pinMode(13,INPUT);
}
void loop()
{
if (Serial.available() > 0){ // Check serial buffer for characters
if (Serial.read() == 'r') { // If an 'r' is received then read the pins
for (int pin= 0; pin<=5; pin++){ // Read and send analog pins 0-5
x = analogRead(pin);
sendValue (x);
}
for (int pin= 2; pin<=13; pin++){ // Read and send digital pins 2-13
x = digitalRead(pin);
sendValue (x);
}
Serial.println(); // Send a carriage returnt to mark end of pin data.
delay (5); // add a delay to prevent crashing/overloading of the serial port
}
}
}
void sendValue (int x){ // function to send the pin value followed by a "space".
Serial.print(x);
Serial.print(32, BYTE);
}
please can you put them cod and save give me please cod ? because i don't find I do not know what to do thanks
There is one occurrence of a Serial.print() with the BYTE keyword in it.
Replace it with
Serial.write(32);
ok done compling thanks, but after clicked I run max msp and (Arduino2MaxNovember2010_V.5) patch. toggle click COM 2 how can i do that now because my sensor is does not eork right now ?
i changed com 2 to bluethoot pda sync and analog input ra0 ra1 ra2 ra3 ra4 ra5 its is work very fast number changes. is it connect arduino to max ? ( my sensor put on the ardunio analog signal A1 )
Does your Arduino have Bluetooth?
I don't know anything about Max.
No, i connect COM 2