This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf52832 I want to use acc and ble at the same time.

I want to read the acceleration sensor value using the example of the ble-hid-keyboard, but if I let you read the acceleration sensor value, Bluetooth will be cut off. Can we solve this problem?

5282.main.c.txt

Parents Reply
  • If you put the code like that, CalibAccel/calcDT/calcAccelYPR/calcGyroYPR/calcFilteredYPR/nrf_delay_ms(50) will be called every time the chip wakes from sleep to perform a task. If you have any sources in your application that will wake the chip from sleep (timers, etc), this should work. If there are no wakeup sources, the application will go to sleep and stay there forever. In general, it is a better approach to do the function-calls in a timer event if you want to do a regular read of the sensor. Alternatively, you can set a flag in the timer event handler, and read the sensor in main-loop if the flag is set.

Children
Related