Arduino & Jitter

Mar 2, 2010 at 7:42pm

Arduino & Jitter

Hi guys,

I’m having a bit of trouble trying to get my head around this. What I am doing is using a switch with Arduino and counting how many times that the switch has been pressed. The switch is taking the place of a heart rate monitor with a digital output which I will be using later in the project.

What I want to do is send a message to Jitter once the switch has been pressed a certain amount of times to begin playing a movie clip.
I want to trigger a video to play when Jitter receives a BANG from Arduino (With a number?).

Here is the Arduino Sketch that I am using, it seems to be working fine, it is just getting it to send messages to Jitter that I am having trouble with. I don’t know if it will help on the cyclying74 formus!:

Code:

const int buttonPin = 7; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin

int val;

int buttonState = 0;

void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);

Serial.begin(9600);
}

void loop(){

buttonState = digitalRead(buttonPin);

if (buttonState == LOW) {

digitalWrite(ledPin, LOW);

Serial.print(“n Times the button was pressed = ” );
Serial.println(val);

delay(500);

val++;

}
else {

digitalWrite(ledPin, HIGH);
}
}

Any help would be appreciated.

#48867

You must be logged in to reply to this topic.