BLE_IAS with 2 button toggle function

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I'm working to modify the Central/Peripheral code from 100 Project-100 Days, and would like to add a Pin Input/another button.  So, I'm trying to figure out how to use the same software debouncing method, interrupt, and DeepSleep functions, yet have each button change the alert variable a different way.  One button will hop between Mild- and Full-Alert, while the second button will hop between No Alert and the last alert prior to button 2 was pressed, like a quick bypass.  I have attached the Central code, and so far I've gotten it to connect to the peripheral, but no button functionality afterward.  Any insight would be appreciated, and since the button reads is the only thing needed, I wouldn't be opposed to using Debounce either, if necessary.

0 Likes
1 Solution
Anonymous
Not applicable

Hi,

   

The switches are connected to pins P2[3] and P2[4]. Can you change the drive mode from Strong Drive to Resistive Pull-Up? Also how are you interfacing these switches?

View solution in original post

0 Likes
2 Replies
Anonymous
Not applicable

Hi,

   

The switches are connected to pins P2[3] and P2[4]. Can you change the drive mode from Strong Drive to Resistive Pull-Up? Also how are you interfacing these switches?

0 Likes
Anonymous
Not applicable

Thank you and sorry for the last response.  I have changed the drive mode.  I can get the functionality, as far as reading a button press, but I'm looking for a way to software debounce both buttons.  I don't know if I need to have 2 different CheckButtonStatus functions and/or 2 different sets of variables, etc, or if there's a way to have one function check both buttons then debounce one that is presses with a different result, ie if (button1) {iasAlert = 0}, if (button2){iasAlert = 1 or 2}.  I would rather use a hardware debounce, but this app will probably use EZ or PRoC.

0 Likes