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

cross mob
Anonymous
Not applicable
In hello_sensor.c, it says hello_sensor_interrupt_handler allows for three interrupt inputs where the buttons are defined as..

Button1 : value&0x01

Button2 : (value&0x02)>>1

Button3 : (value&0x04)>>2

When I press SW1 on the TAG board, this registers as Button1. If I were to add more buttons, how would I configure them as Button2 and Button3? I do realize I have to initialize as buttons/inputs/low/interrupt, but I am guessing there is more to it than that.

Thanks
0 Likes
1 Solution
VictorZ_46
Employee
Employee
5 comments on blog 25 sign-ins 250 likes received
The Tag board which is provided with SDK has only 1 button exposed.  If you can wire GPIO pins, any unused GPIO can be used as buttons 2 or 3.  You will need to modify hello_sensor_gpio_cfg to add the pin number and the flags.  Check the button definition in WICED_Smart_SdkInlcudePlatformsBCM920732TAG_Q32platform.h.  For button 2 flags would look something like that

#define GPIO_SETTINGS_BUTTON2  (GPIO_INPUT  | GPIO_INIT_LOW  | GPIO_BUTTON2 | GPIO_INT)

View solution in original post

20 Replies