condition = true but do...while loop does not end

Hi
Does the whole code compile?

You have declared the variable
int status_slave inside { },
so it is local to the code inside the { }

but you are using it outside the { } in the while command.

I think you should be declaring status_slave as a global variable.

Tom... :slight_smile: