Let me reformat your code so it's a little easier to read (in the future, please use code tags when posting code, it makes it much easier to read and you code doesn't get reformatted by the forum software)
myservo.write(90);
switch(pulso){
case 0:
left();
delay(250);
break;
case 45 :
left();
delay(500);
STOP();
break;
case 135 :
right();
delay(250);
break;
case 180 :
right();
delay(500);
break;
(By the way, you are missing the closing brace for the case statement. I'm guessing it's there in your sketch and you just didn't copy that far when you posted the code.)
Now, for your question:
McAndrew:
Imagine that the next piece of code , there are two or more case that are true in the same program cycle ... how do I do ?, since it is assumed that can only be truly one of the functions .
I don't understand the concern. A variable can only have one value at a time, and the case statement evaluates the value and selects the one case alternative that matches. How could it possibly match more than one of the case alternatives at once? To do so, the variable being tested would need to have two values at once, and that simply isn't possible.
When the case statement is evaluated, it checks the value of pulse0. If it is 0, 45, 90, 135, or 180, the corresponding case alternative is executed. If it's something else, nothing is executed (because you have no default: alternative.)
Perhaps one of those functions you call might change the pulseo value? Your concern might be that it would then match a different case alternative? For example, what happens if pulseo is zero, and calling left() changes pulseo to 45? In that case, when you reach the case statement, pulseo is evaluated, found to be zero, so the zero case alternative is executed. That alternative calls left() and changes pulseo, but that doesn't matter since the case statement will not re-evaluate pulseo again (until the next time the code loops around and the case statement is encountered again.) Even though the value of pulseo might now be 45 by the time the code completes the case 0 alternative, the remaining case alternative will not be considered during this pass.
You can think of a case statement to be a simpler way of writing this:
if (pulseo == 0)
{
// do something
}
else if (pulseo == 45)
{
// do something
}
else if (pulseo == 90)
{
// do something
}
else if (pulseo == 135)
{
// do something
}
else if (pulseo == 180)
{
// do something
}
In this construct, only one of the "do something" sections will ever be executed during a single pass through the code.
Now, suppose left() is changing the value of pulseo and you DID want the subsequent alternatives to be considered. Then, instead of the case statement, you'd need to write a complex if statement like the above example, but leave out the "else" keywords. That makes each if statement stand on its own, and each one will be evaluated in turn, regardless of which previous ones evaluated to true.
if (pulseo == 0)
{
// do something
}
if (pulseo == 45)
{
// do something
}
if (pulseo == 90)
{
// do something
}
if (pulseo == 135)
{
// do something
}
if (pulseo == 180)
{
// do something
}
If puslseo started out as 0, and each "do something" incremented pulseo by 45, then ALL of the if statements would evaluate true and all of them would be executed.
Did this cover your concern, or is it something else?