I’ve gotten used to basic commands, I’m exploring waitUntil’s bar & what the equals and exclamation, less, greater signs mean. I have never used this and have only used basic commands.
I have tried to go over it multiple times but alas, not a programmer at heart. Can anyone teach me what these are as if I am only five?
These nomenclatures are used based on the C language. in C “=” and “==” mean two different things.
If you want to set a variable with a value you would use “x = 5;”. That is an action, x is set to a value of 5.
If you want to test a variable against something (compare) you would use “x == 5”, that is a question, is “x” equal to “5”?
If you want to see if a variable is not equal to something then you would use “x != 5”, that is a question, is “x” not equal to “5”?
If you want to see if a variable is greater than or equal to something then you would use “x >= 5”, that is a question, is “x” greater than or equal to “5”?
If you want to see if a variable is greater than something then you would use “x > 5”, that is a question, is “x” greater than “5”?
One other thing to remember when using waitUntil() to wait for a motor or something to get to a certain position is do not use the “==”. The reason is that you may miss that particular position if going fast enough. Know what direction you are going in and use “>=” or “<=” instead.