You need to put your button reads and response within the loop that performs each step of brightness change.
You probably have it outside a loop that gets to complete before caring about your button.
You need to put your button reads and response within the loop that performs each step of brightness change.
You probably have it outside a loop that gets to complete before caring about your button.