Button debouncing, start bot logic.
More...
#include <avr/io.h>
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Macros |
#define | RED_BUTTON 0 |
#define | L_UP_BUTTON 1 |
#define | L_DOWN_BUTTON 2 |
#define | R_UP_BUTTON 3 |
#define | R_DOWN_BUTTON 4 |
#define | NEST_BUTTON 5 |
#define | NUM_BUTTONS 6 |
#define | RED_BUTTON_DOWN bit_is_clear(PIND,6) |
#define | L_UP_BUTTON_DOWN bit_is_clear(PINA,0) |
#define | L_DOWN_BUTTON_DOWN bit_is_clear(PINA,1) |
#define | R_UP_BUTTON_DOWN bit_is_clear(PINA,2) |
#define | R_DOWN_BUTTON_DOWN bit_is_clear(PINA,3) |
#define | NEST_BUTTON_DOWN bit_is_clear(PINB,0) |
#define | BREAK_BEAM_TRIGGERED bit_is_set(PINB,1) |
Functions |
void | initButtons (void) |
void | waitFor (uint8_t button) |
bool | justPressed (uint8_t button) |
bool | justReleased (uint8_t button) |
void | debounceButtons (void) |
| Maintains wasEvent[] and toggles isDown[].
|
bool | isPressed (uint8_t button) |
bool | bothRightButtonsPressed (void) |
bool | bothLeftButtonsPressed (void) |
Detailed Description
Button debouncing, start bot logic.
Definition in file buttons.h.
Function Documentation
bool isPressed |
( |
uint8_t |
button | ) |
|
|
inline |
- Returns
- true when button is currently down (does no debouncing!)
Definition at line 114 of file buttons.c.
bool justPressed |
( |
uint8_t |
button | ) |
|
|
inline |
- Returns
- true when confirmed rising edge at last debouncing.
Definition at line 50 of file buttons.c.
bool justReleased |
( |
uint8_t |
button | ) |
|
|
inline |
- Returns
- true when confirmed falling edge at last debouncing.
Definition at line 58 of file buttons.c.