static void button_event_handler(uint8_t pin_no, uint8_t button_action) { if (button_action == APP_BUTTON_PUSH) { switch (pin_no) { case HR_INC_BUTTON_PIN_NO: //push button 0 // Increase Heart Rate measurement m_cur_heart_rate += HEART_RATE_CHANGE; if (m_cur_heart_rate > MAX_HEART_RATE) { m_cur_heart_rate = MIN_HEART_RATE; // Loop back } break;
case HR_DEC_BUTTON_PIN_NO: //push button 1
// Decrease Heart Rate measurement
m_cur_heart_rate -= HEART_RATE_CHANGE;
if (m_cur_heart_rate < MIN_HEART_RATE)
{
m_cur_heart_rate = MAX_HEART_RATE; // Loop back
}
break;
default:
APP_ERROR_HANDLER(pin_no);
break;
}
}
}
this example is ble_app_hrs 's button part. I want change this part. ( if I push button 0 , ADC enabling, if I push button 1 , ADC disenabling ) then digital data is transmitted to DK Kit through bluetooth.
I have some questions for solving this problem.
-
where input 3-axis sensor's x-axis values? ( ADC pin? or other pin? )
-
How convert sensor values to digital data?
-
How write/read this data?