EV3RT C API Reference [English]
An RTOS-based development platform for LEGO Mindstorms EV3.
 All Data Structures Functions Variables Enumerations Enumerator Groups

Definitions of API for controlling buttons of an EV3 intelligent brick. More...

Enumerations

enum  button_t {
  LEFT_BUTTON = 0,
  RIGHT_BUTTON = 1,
  UP_BUTTON = 2,
  DOWN_BUTTON = 3,
  ENTER_BUTTON = 4,
  BACK_BUTTON = 5,
  TNUM_BUTTON = 6
}
 Enumeration type for buttons. More...
 

Functions

bool_t ev3_button_is_pressed (button_t button)
 Get the pressed state of the button. More...
 
ER ev3_button_set_on_clicked (button_t button, ISR handler, intptr_t exinf)
 Attach a click event handler for a button. More...
 

Detailed Description

Definitions of API for controlling buttons of an EV3 intelligent brick.

Enumeration Type Documentation

enum button_t

Enumeration type for buttons.

Enumerator
LEFT_BUTTON 

Left button.

RIGHT_BUTTON 

Right button.

UP_BUTTON 

Up button.

DOWN_BUTTON 

Down button.

ENTER_BUTTON 

Enter button.

BACK_BUTTON 

Back button.

TNUM_BUTTON 

Number of buttons.

Function Documentation

bool_t ev3_button_is_pressed ( button_t  button)

Get the pressed state of the button.

When an invalid button number is specified , always returns false [TODO: check - error log is output].

Parameters
buttonButton number
Return values
truePressed state
falseUnpressed state
ER ev3_button_set_on_clicked ( button_t  button,
ISR  handler,
intptr_t  exinf 
)

Attach a click event handler for a button.

[TODO: sync with jp version]

The button handler executes in the task contest. The default is called from the wait disabled state.

Parameters
buttonthe button to be set
handlerthe handler to be attached, NULL for clearing the current handler
exinfextra information passed to the handler when it is called
Return values
E_OKSuccessful completion
E_IDInvalid button number