The accelerometer has two outputs called INT1 and INT2, which can generate pulses, which can then be used for interrupts (I believe, correct me if I'm missing something). I'm trying to let the accelerometer constantly run and when a certain threshold is exceeded, INT1 will be set high (which I'll connect to a pin on the arduino and I'll use attachInterrupt() with it to determine the next action for the program).
I already have INT1 outputting a signal so I know it's possible to generate an output, I just don't know how to correctly set it as well as the threshold since it seems I can only set 127 (1111111) and most values are +-5500. Even when all the values are negative, I'm still getting a high output signal from INT1 which is more confusing since at least 127 is greater than those values, so I know I'm not configuring it right.
For reference, I'm setting up the registers and interrupts from the tables on pages 24-37 of the data sheet (https://www.sparkfun.com/datasheets/Sensors/Accelerometer/LIS331HH.pdf). And sorry about the lack of indenting, that's just how I found the code and never bothered to reformat it.