Skip to content

Buttons

Tasssadar edited this page Jul 5, 2011 · 2 revisions

You can use input from 3 buttons(A, B and C) in your program. Their masks on PORTB are defined as BUTTON_A, BUTTON_B and BUTTON_C.

These mask are also to be used in these functions:

inline bool isPressed(uint8_t buttons);

Returns true if button(s) is(are) pressed.

inline uint8_t waitForPress(uint8_t buttons);

Blocks program until button(s) is/are pressed.

inline uint8_t waitForRelease(uint8_t buttons);

Blocks program until button(s) is/are released.

inline void waitForButton(uint8_t buttons)

Blocks programu until button(s) is/are pressed AND released.

Clone this wiki locally