Programing Switches in Adruino

Hello , I am new in programing ,so i have some questions. :slight_smile:
Can someone help me to build a code for controling switches.
I want program to wait until Switch 1 i active and give power to another pin , then when switch 2 is active to stop switch 1 and give power to another pin , then switch 3 stop power and return to beginning to wait swtich 1 ?
Sorry for poor English

Thanks

What kind of switch do you have that needs programming? Can the switch be programmed using the Arduine IDE?

Can someone help me to build a code for controling switches.

Every device I've seen has switches that are controlled by the human operator.

I want program to wait until Switch 1 i active

Oh, so you are not trying to control the switches. Good thing, since you can't.

What is the problem? What have you tried? Reading the state of a pin that a (properly wired) switch is connected to is trivial - one line of code.

It is ON OFF Switches and when switch is active give power to motor and waits to hit the next switch . I have searched but i can't find this kind of code that wait until switch is ON and perfom the next step :(. Or maybe i have mised it .

i can't find this kind of code that wait until switch is ON

   while(digitalRead(mysteriousSwichPin) == HIGH) // Or LOW, if LOW means off
   {
      // do nothing
   }
   // OK, the switch is ON