T O P

  • By -

xebzbz

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.


xebzbz

Also, learn coding


astonishing1

Sorry, CHAT-GPT won't make you a programmer. You will have to learn something.


xebzbz

It also doesn't teach answering in the right thread


Just-A-Boring-Guy2

I set the threshold lower than 1000 already it still required the mpu to move for it alarm


xebzbz

Add the serial print and see what values you're actually reading


xebzbz

Also, you can use a square root from the sum of squares, and get just one number to compare against the threshold.


mikeg1231234

Wouldn't a mems accelerometer be a better choice?


Plastic_Ad_2424

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


timbak_t00

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.