Skip to main content

Callbacks

The Smart Multibox uses callbacks to communicate system events to the user code. These functions allow you to select which function is called for each of these events. On powerup, none of these callbacks are defined.

multibox_set_button_cb(cb_func)

Sets a callback function to be called when the button is pressed or released. The function should be in the following format:

button_cb(pressed)

Where pressed is a Boolean value that is True indicating the button is pressed or False if the button is released.

multibox_set_exp_pedal_cb(cb_func)

Sets a callback function to be called when the connected expression pedal moves. The function should be in the following format:

exp_pedal_cb(value)

Where value is a value between 0 and 255.

multibox_set_ext_switch_cb(cb_func)

Sets a callback function to be called when the connected external switch changes state. The function should be in the following format:

ext_switch_cb(sw_num, pressed)

Where sw_num is EXTSWITCH_TIP or EXTSWITCH_RING and pressed  is a Boolean value that is True indicating the button is pressed or False if the button is released.