Mutila: Mouse's Utilities for Arduino
Oft-used utilities: debouncing buttons, averaging samples, and so on.
src
ToggleButton.h
1
#pragma once
2
3
#include "DebouncedButton.h"
4
9
class
ToggleButton
{
10
public
:
24
ToggleButton
(uint8_t pin,
bool
pullup=
true
);
25
37
void
begin
(
bool
startState=
false
, uint8_t threshold=AbstractDebouncedButton::DefaultThreshold, uint8_t delay=AbstractDebouncedButton::DefaultButtonDelay);
38
43
void
update
();
44
50
bool
on
();
51
52
private
:
53
DebouncedButton
_button;
54
bool
_toggled;
55
56
};
57
ToggleButton::ToggleButton
ToggleButton(uint8_t pin, bool pullup=true)
Definition:
ToggleButton.cpp:3
DebouncedButton
Definition:
DebouncedButton.h:15
ToggleButton::begin
void begin(bool startState=false, uint8_t threshold=AbstractDebouncedButton::DefaultThreshold, uint8_t delay=AbstractDebouncedButton::DefaultButtonDelay)
Definition:
ToggleButton.cpp:8
ToggleButton::update
void update()
Definition:
ToggleButton.cpp:14
ToggleButton::on
bool on()
Definition:
ToggleButton.cpp:22
ToggleButton
Definition:
ToggleButton.h:9
Generated by
1.8.15