Programming an automated fire extinguisher.

You are missing this:

int button2State = 0;

You should try to compile the code before posting... :wink: