Author Topic: Module 120 accelerometer communications  (Read 555 times)

SK

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Module 120 accelerometer communications
« Reply #15 on: December 12, 2016, 03:44:45 pm »
Hi Nick

I was wondering what this line does?
Code: [Select]
(accel.GetINT1ActiveInterrupt() & LIS2DH12.INT_ACTIVE) = LIS2DH12.INT_ACTIVE
You've said that you use accel.GetINT1ActiveInterrupt() to clear interrupt but why compare LIS2DH12.INT_ACTIVE to itself?
If I wanted to clear all interrupts in the INT SRC register, how long would I have to loop for?
Something like this?
Code: [Select]
Do
    Thread.Sleep(1000000)
    INTMSG = accel.GetINT1ActiveInterrupt()
While ((accel.GetINT1ActiveInterrupt() & LIS2DH12.INT_ACTIVE) = LIS2DH12.INT_ACTIVE)

Cheers