We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › I don't get the if running
Page Index Toggle Pages: 1
I don't get the if running (Read 292 times)
I don't get the if running
Jul 10th, 2006, 8:57pm
 
Hello, since two hours I'm trying this:

Code:

void serialEvent(char pin){
 print(pin);
 if(pin == "PIN: 1"){
   println("Pin 1 was pressed!");
 }
}


Why doesn't it work?
please please help me,

Rasso
Re: I don't get the if running
Reply #1 - Jul 10th, 2006, 9:25pm
 
the solution:
Code:
void serialEvent(char pin){
if(pin == '1'){
print("juhuu");
}
print (pin);
}

I needed just the ' instead of the ". thats all.
Page Index Toggle Pages: 1