Hi, I'm building a game where movement sets off an alarm. The amount of movement (i.e. sensitivity threshold) is specified at the beginning of the game.
I'm using an MPU6050 and have so far been using a loop to compare values and trigger the alarm when the threshold is crossed. It's proving difficult to stop it freezing, however, and I suspect it may be due to my Nano being overloaded.
My questions: 1. Would using interupts - as in the Jeff Rowberg code - be a better approach? Or is it a bad use-case? 2. Is the threshold for triggering the interupt adjustable? I've been searching for a long while and can't get my head around when it will be triggered, because the values have some natural fluctuation anyway. With a self-balancing robot, for example, surely the interupt is being fired constantly?
I've got hunch my conceptualisation is wrong somewhere, but would appreciate any pointers. Many thanks, Paul