high and low output (LED)

My problem is when the LED is "High" or "On", I want the code(inside) to be disable... e.g. accelerometer code... I want to put an LED on it when it is turn on, the accelerometer will not be function...

and when the LED is "Low" or "Off", I want it to go back or enable...

Can anyone willing to help me to teach what is the command fit for it....

this is my email address: rowell_regis19@lsu.edu.ph

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

oh yeah... i try.. thanks for that....