I am trying to make a noise detector. I use two regular electronic push button. If button A is pressed one code will be run. If button B is pressed, another different code will be run. Inside both of this a and b code there is another if statement respectively.
I wanted to create an if statement based on push button input for the first choice and inside this A and B code there will be another if statement based on the sensor input. Could this work?
akubas86:
I am trying to make a noise detector. I use two regular electronic push button. If button A is pressed one code will be run. If button B is pressed, another different code will be run. Inside both of this a and b code there is another if statement respectively.
I wanted to create an if statement based on push button input for the first choice and inside this A and B code there will be another if statement based on the sensor input. Could this work?
Sure! That is just another way of writing "If x is true AND y is true, do something".