I can't get my if statement to work when comparing two values. It works if I replace the barkthreshold with a number. The serial monitor shows both values as I expect them to be, so I can't figure out why it can't see that intensity is greater than barkthreshold. I feel dumb!
int barkthreshold = intensity+100;
if (intensity>barkthreshold)
{digitalWrite(amplifier,HIGH);
digitalWrite(playbutton,HIGH);}