Zumo32U4 library
Zumo32U4Buttons.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 ZUMO_32U4_BUTTON_A 14
14
18#define ZUMO_32U4_BUTTON_B IO_D5
19
21#define ZUMO_32U4_BUTTON_C 17
22
25{
26public:
28 {
29 }
30};
31
43{
44public:
45
46 virtual bool isPressed()
47 {
48 USBPause usbPause;
51 _delay_us(3);
53 }
54};
55
67{
68public:
69
70 virtual bool isPressed()
71 {
72 USBPause usbPause;
75 _delay_us(3);
77 }
78};
79
#define ZUMO_32U4_BUTTON_A
static void setInputPulledUp() __attribute__((always_inline))
Sets a pin to be a digital input with the internal pull-up resistor enabled.
Definition: FastGPIO.h:400
static bool isInputHigh() __attribute__((always_inline))
Reads the input value of the pin.
Definition: FastGPIO.h:410
General pushbutton class that handles debouncing.
Definition: Pushbutton.h:71
Main class for interfacing with pushbuttons.
Definition: Pushbutton.h:138
Pushbutton(uint8_t pin, uint8_t pullUp=PULL_UP_ENABLED, uint8_t defaultState=DEFAULT_STATE_HIGH)
Definition: Pushbutton.cpp:120
Interfaces with button A on the Zumo 32U4.
Interfaces with button B on the Zumo 32U4.
virtual bool isPressed()
indicates whether button is currently pressed without any debouncing.
Interfaces with button C on the Zumo 32U4.
virtual bool isPressed()
indicates whether button is currently pressed without any debouncing.