Accelerometer and LED Code Help

Hi all,

I'm relatively new to coding and everything but I'm working on a project so when the accelerometer reaches 90g's the LED will turn on. I want the led to stay on for 5 minutes. Again, I'm new to coding and everything so take it easy on me. Feedback is very helpful!

Thanks!

int scale = 3;
boolean micro_is_5V = false;
int x = 90;
boolean led = false

void setup()
{
Serial.begin(115200); // Initialize serial communication at 115200 baud
pinMode(LED_BUILTIN, OUTPUT);

}

void loop()
{
int rawX = analogRead(A0); //Sets X-Axis to Analog input A0
int rawY = analogRead(A1);
int rawZ = analogRead(A2);

float scaledX, scaledY, scaledZ; // Scaled values for each axis
if (micro_is_5V) // microcontroller runs off 5V
{
scaledX = mapf(rawX, 0, 675, -scale, scale); // 3.3/5 * 1023 =~ 675
scaledY = mapf(rawY, 0, 675, -scale, scale); // 3.3/5 * 1023 =~ 675
scaledZ = mapf(rawZ, 0, 675, -scale, scale); // 3.3/5 * 1023 =~ 675
}
else // microcontroller runs off 3.3V
{
scaledX = mapf(rawX, 0, 1023, -scale, scale);
scaledY = mapf(rawY, 0, 1023, -scale, scale);
scaledZ = mapf(rawZ, 0, 1023, -scale, scale);
}

Serial.print("X: "); Serial.print(scaledX); Serial.println(" g");
Serial.print("Y: "); Serial.print(scaledY); Serial.println(" g");
Serial.print("Z: "); Serial.print(scaledZ); Serial.println(" g");

if (rawX or rawY or raw Z>x) //if the accelerometer value in any direction is greater than the given amount
{
digitalWrite(LED_BUILTIN, HIGH); //LED on
}
}

Have you compiled and tested this?

This:

if (rawX or rawY or raw Z>x)

is likely incorrect

maybe should be

if ((rawX > x) || (rawY > x) || (raw Z>x))

there may be many more issues.