@catoyo
Hi, If you have a three pin sensor the following Arduino setup is likely to work. If the sensor indicates 5v, it requires the Arduino code to be uploaded to a board with 5v pin like the UNO - which is what I have just tested it on using a 3 pin Pulse Sensor. The pin out is GND, 5V and the data / SIG (signal) pin is A0. If it is a digital pmw then change the signal to a digital pin on the Arduino board.
With the sensor correctly wired to the Arduino attach it to your computer using a USB cable. Start up Arduino.IDE and upload the code at the end of this post to your board of choice. Start up Isadora and from the Communication menu select the Serial Port Setup... In the dialog that opens go to Port 1 and in the pop-up choose the usbmodem14424 or similar as the Device. The Arduino code has a speed set to 9600 so set the speed of Port 1 to match. Leave the other values unchanged from the default. OK the changes and close the dialog. If the usb serial connection is not available you can use the button 'Detect Serial Ports' on the bottom left of the dialog box. When the dialog has closed go back to the Communication menu and check 'Enable Serial Ports'.
In the Isadora patch you want a 'Serial In Watcher - Text' actor with the parameters- 1: port, on: enable, 10: eom char. Inside the "Serial In Watcher' is this parser string:
"Pulse Data: " pulse_sensor:float=4.#
You can also look at the Windows/Show Monitor to see if the data stream is being received.
Following is the Arduino code:
int Press = A2;
int PressCapture;
int PulseSensor = A0;
int DelayTime = 25;
int PulseCapture;
void setup(void) {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
// while the serial stream is not open, do nothing:
while (!Serial) ;
}
void loop(void) {
PulseCapture = analogRead(PulseSensor);
PressCapture = analogRead(Press);
Serial.print("Pulse Data: ");
Serial.println(PulseCapture);
Serial.print("Press Data: ");
Serial.println(PressCapture);
delay(DelayTime);
}
best wishes
Russell