Romi32U4 library
Romi32U4Buttons.h
Go to the documentation of this file.
1 // Copyright Pololu Corporation. For more information, see http://www.pololu.com/
2 
5 #pragma once
6 
7 #include <Pushbutton.h>
8 #include <FastGPIO.h>
9 #include <USBPause.h>
10 #include <util/delay.h>
11 
13 #define ROMI_32U4_BUTTON_A 14
14 
18 #define ROMI_32U4_BUTTON_B IO_D5
19 
21 #define ROMI_32U4_BUTTON_C 17
22 
25 {
26 public:
28  {
29  }
30 };
31 
43 {
44 public:
45 
46  virtual bool isPressed()
47  {
48  USBPause usbPause;
51  _delay_us(3);
53  }
54 };
55 
67 {
68 public:
69 
70  virtual bool isPressed()
71  {
72  USBPause usbPause;
75  _delay_us(3);
77  }
78 };
79 
virtual bool isPressed()
indicates whether button is currently pressed without any debouncing.
Interfaces with button A on the Romi 32U4.
static bool isInputHigh() __attribute__((always_inline))
Reads the input value of the pin.
Definition: FastGPIO.h:352
Main class for interfacing with pushbuttons.
Definition: Pushbutton.h:137
virtual bool isPressed()
indicates whether button is currently pressed without any debouncing.
Pushbutton(uint8_t pin, uint8_t pullUp=PULL_UP_ENABLED, uint8_t defaultState=DEFAULT_STATE_HIGH)
Definition: Pushbutton.cpp:120
static void setInputPulledUp() __attribute__((always_inline))
Sets a pin to be a digital input with the internal pull-up resistor enabled.
Definition: FastGPIO.h:342
General pushbutton class that handles debouncing.
Definition: Pushbutton.h:70
Interfaces with button B on the Romi 32U4.
Interfaces with button C on the Romi 32U4.
#define ROMI_32U4_BUTTON_A