Explain the concept of volatile variables in C and describe a scenario where failing to use them would cause hardware control errors.