Go Down

Topic: Communication between Arduino and Max Msp  (Read 149 times) previous topic - next topic

Eleonore258

Hi, i am trying to realize a project. And i am a little bit lost.
I am trying to have a bang in Max msp by pressing a push button on arduino. I have red all the documentation of Maxuino but i was thinking that i could just use the serial fonction on max msp maybe. Do you have any other documentations or recommendation to realize that?


here is my code but the led13 doesn't light up and  i am not sure why it's not working. :(

Code: [Select]
const int buttonPin = 2;
const int ledPin = 13;
 
int buttonState = 0;
int lastButtonState = 0;
int randVal =0;
int randValZ =0;
 
void setup() {
  // put your setup code here, to run once:
pinMode(buttonPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);

}

void loop() {
  // put your main code here, to run repeatedly:
randVal = random(1000);
randValZ = random(1000);

buttonState = digitalRead(buttonPin);

if (buttonState != lastButtonState) {


 if(buttonState == HIGH) {
 
 }else{
  Serial.println(randVal);
 
  }
   delay(500);
   
 }

 lastButtonState = buttonState;
 
}

slipstick

Where in that code do you think that you have asked the LED light up?

Steve

Go Up