need help with if statement.

can you please h

What have you tried? How did it work or not work? You're asking for the most basic line of code one could imagine, so I assume that you've at least looked at examples of if statements and tried something.

i am completely new to this coding.

i am trying to write an if statement if the value goes over this then execute this video. right now everything is working but i press play on processing everything works but now i need a code that says that if the value goes over this then trigger this video .

james234:
right now everything is working but …

… you are not. You have not posted your program.

And when posting code please use the code button </>so your code looks like thisand is easy to copy to a text editor See How to use the Forum

…R

i cannot post my code as it is a project and it will be recognized as plagiarism so im asking for the most simple code to use to execute the video that i have in my project.

i cannot post my code

Then you're pretty much hosed.

if(someVariable > 15){
    // do your thing it's over 15
}

That's an if statement that checks if a variable is greater than 15. That is SO trivial that I'm sure it's not your issue. Surely you could write that line. So without your code so we can see the actual problem there's not a lot more we can do.

jjjj

Please read this:-
How to use this forum
Because your post is breaking the rules about posting code.

thats my code how can i do it now?

That is not Arduino code, what are you playing at?

i cannot post my code as it is a project and it will be recognized as plagiarism

Are you saying that you have stolen code that does not work? That is what the words say but maybe English is not your first language.

Use code tags.

That's not Arduino code. And you haven't said anything about which value you want to test or where it comes from. All you did was post code and a demand.

First off, put the code in code tags like you were asked in reply #3. And then take a little time to explain yourself here and what exactly you want.

hh

james234:
okay so basically im using arduino and processing, what i have to do is basically when the values change for example in the code above the if statement it says ((result1 > 30)) now what can i do to write the code so if the value goes over 30 then play the movie?

Well you've already got the if statement there so you're not asking how to write that. Are you asking what command starts the movie? What are you using to play the movie. Does the command at the end of setup (myMovie.play()) play the movie? If so, then that's the command you put in the if statement.

Don't you think that what program or hardware or whatever is playing this movie would be a pretty critical piece of information to give us?

Use print statements to see where your code is and also what value certain variables are. That will tell you where you are going wrong. It looks to me like it is in the serial input.

Yes that's what I mean what command do I use in the if statement to play the movie if the value goes over 30 and I'm using QuickTime player.

james234:
and I'm using QuickTime player.

On what Arduino?

This seems to be a question about Processing that has nothing whatsoever to do with Arduinos. So why are you asking the question on the Arduino Forum?

...R