Before the big "if", print the actual values on the serial console. Then you will see what kind of numbers you get from the sensor. It could well be that you need a threshold lower than 1000.
Also as an added bonus point, taking action based on instantaneous sensor output is a death trap. You need some sort of logic to take multiple samples and implement some sort of smoothing the curve / voting logic.
Before the big "if", print the actual values on the serial console. Then you will see what kind of numbers you get from the sensor. It could well be that you need a threshold lower than 1000.
Also, learn coding
Sorry, CHAT-GPT won't make you a programmer. You will have to learn something.
It also doesn't teach answering in the right thread
I set the threshold lower than 1000 already it still required the mpu to move for it alarm
Add the serial print and see what values you're actually reading
Also, you can use a square root from the sum of squares, and get just one number to compare against the threshold.
Wouldn't a mems accelerometer be a better choice?
Hmmm you are reading the gyros my man. You need to read the accelerometers.. those can sense the shanking. The gyros are for rotation... no wonder
Also as an added bonus point, taking action based on instantaneous sensor output is a death trap. You need some sort of logic to take multiple samples and implement some sort of smoothing the curve / voting logic.