IF/ELSE statements. if(LEDstate != HIGH) { // go to accel function and get accelerometer data }, else //do nothing