Hello, i am working on a rotation counter, i am using adc and LPCOM with nrf52832 DK board. but LPCOM code is not working.
static void lpcomp_event_handler(nrf_lpcomp_event_t event)
{
// Clear event
if (event == NRF_LPCOMP_EVENT_CROSS)
{
rotation_int++;
}
// Toggle pin to indicate triggering of event
}
/**
* @brief Initialize LPCOMP driver.
*/
void LPCOMP_init(void)
{
uint32_t err_code;
// initialize LPCOMP driver, from this point LPCOMP will be active and provided
// event handler will be executed when defined action is detected
err_code = nrf_drv_lpcomp_init(NULL, lpcomp_event_handler);
APP_ERROR_CHECK(err_code);
nrf_drv_lpcomp_enable();
}