//Initilaize the setpoint int volatile setpoint; //the set point is volatile because we are changing within interupts //Minimum time between button hits in milliseconds double debouncetime = 100; //increase if output flickers //Time at which a button was last hit double buttonhittime = 0; void setup() { //Set up the buttons to run the interupt code //Refer to the online list to see which interupts you can connect your buttons to //In this case the button outputs are on digital pins 2 and 3 attachInterrupt(0, incrementSetPoint, FALLING); attachInterrupt(1, decrementSetPoint, FALLING); //whatver other setup code goes here } void loop() { //your code goes here } void incrementSetPoint() { if ((millis()- buttonhittime) > debouncetime) { setpoint = setpoint + 1; buttonhittime = millis(); } } void decrementSetPoint(){ if ((millis()- buttonhittime) > debouncetime) { setpoint = setpoint - 1; buttonhittime = millis(); } }