switch(stato){
case 0:
while(!stato) {
printLifeBar();
std::cout << "[1]" << move1 << std::endl;
std::cout << "[2]" << move2 << std::endl;
std::cout << "[3]" << move3 << std::endl;
std::cout << "[4]" << move4 << std::endl;
std::cin >> stato;
system("clear");
}
break;
case 1:
move_msg.data = stato;
stato = 0;
break;
case 2:
move_msg.data = stato;
stato = 0;
break;
case 3:
move_msg.data = stato;
stato = 0;
break;
case 4:
move_msg.data = stato;
stato = 0;
break;
default:
stato = 0;
}
All this code is put in a special loop(I'm program on raspberry pi with ros). The program is in loop while i don't kill it in a shell.
The program wait the input from user, but i need that the program continue to clear the screen and print another time because the life bar can change its value. Only when user press a number i need to read it. Have you got any idea? thanks :)