Go Down

Topic: simplemessagesystem to connect arduino and Pure data - link not working (Read 3277 times) previous topic - next topic


On this website: http://www.arduino.cc/playground/Interfacing/PD

the link to download simplemessagesystem library is down.

Anyone knows why?

Any alternatives to get the library? (pduino with firmata not working well with ultrasonic sensor-arduino to PD)



I have and I have used it. Thanks.

But what I get is a flickering two digit number. It doesn't really change, it just flickers, as if arduino is sending signal, but something is blocking receiving in Pd. So it seems. Might be wrong of course.

My ping sensor is digital. The tutorial examplifies analog sensor. You think it works for digital sensors as well?

Here is my arduino code if anyone can see anything wrong (it worked nicely with Processing):

Code: [Select]
/* Ultrasonic Sensor
* Reads values (00014-01199) from an ultrasound sensor (3m sensor)
* and writes the values to the serialport.

int ultraSoundSignal = 7; // Ultrasound signal pin
int val = 0;
int ultrasoundValue = 0;
int timecount = 0; // Echo counter
int ledPin = 13; // LED connected to digital pin 13

void setup() {
  Serial.begin(9600);            // Sets the baud rate to 9600
  pinMode(ledPin, OUTPUT);       // Sets the digital pin as output

void loop() {
timecount = 0;
val = 0;
pinMode(ultraSoundSignal, OUTPUT); // Switch signalpin to output

// Send low-high-low pulse to activate the trigger pulse of the sensor

digitalWrite(ultraSoundSignal, LOW); // Send low pulse
delayMicroseconds(2); // Wait for 2 microseconds
digitalWrite(ultraSoundSignal, HIGH); // Send high pulse
delayMicroseconds(5); // Wait for 5 microseconds
digitalWrite(ultraSoundSignal, LOW); // Holdoff

// Listening for echo pulse

pinMode(ultraSoundSignal, INPUT); // Switch signalpin to input
val = digitalRead(ultraSoundSignal); // Append signal value to val
while(val == LOW) { // Loop until pin reads a high value
  val = digitalRead(ultraSoundSignal);

while(val == HIGH) { // Loop until pin reads a high value
  val = digitalRead(ultraSoundSignal);
  timecount = timecount +1;            // Count echo pulse time

//Writing out values to the serial port

ultrasoundValue = timecount; // Append echo pulse time to ultrasoundValue

Serial.write('A'); // Example identifier for the sensor

// Light up LED if any value is passed by the echo pulse

if(timecount > 0){
  digitalWrite(ledPin, HIGH);

// Delay of the program


Go Up