Without knowing, what exactly you want it to do (since you didn't tell us), I see 2 problems in your code: 1. The code around the line marked with "from here" will ask the user over Serial, if he wants to shoot, but directly after it, it will read a value, without waiting for the user to input something. `Serial.read()` will not wait for data to arrive, it will just return -1 if nothing is in the buffer. You have to check, if there is actually something in the buffer with `Serial.available()` and only proceed, if there is actually data to read. 2. In the following if-statement, you first write the value 60 to the servo and directly after it, without any delay, the value 0. The servo doesn't have enough time to get to 60 - or to even start to move - before you tell him to go to 0. The servo needs time for movements. --- Apart from the specific problems with your code, I would use a finite state machine (FSM), to implement it, instead. You declare a global state variable, which represents the possible states, in which your machine can be. If I assume some type of gun/shooting device, these states could be `ASK_USER_TO_POSITION_GUN' and 'ASK_USER_TO_SHOOT'. In each state you check the Serial interface (first with `Serial.available()` then reading with `Serial.read()` if it returns something greater than 0) and based on that input you first take the appropriate action and then do the state transition, by changing the state variable. As example of the general structure: int state = 0; void loop(){ switch(state){ case 0: if(Serial.available()>0){ int input = Serial.read(); //take appropriate action state = 1; //do state transistion } break; case 1: if(Serial.available()>0){ int input = Serial.read(); //take appropriate action state = 0; //do state transition break; } } Pepending on the exact actions to do, you can also tune this, by reading Serial outside of the switch statement and in the case statement only check the input variable. In this case reset the input variable after every interaction.