Arduino-GPIO
General Purpose Input/Output (GPIO) library for Arduino
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Button.ino
Go to the documentation of this file.
1
#include "GPIO.h"
2
#include "
Button.h
"
3
4
#include "
Software/Serial.h
"
5
Software::Serial<BOARD::D0>
Serial
;
6
Button<BOARD::D1>
button
;
7
8
void
setup
()
9
{
10
Serial.
begin
(57600);
11
while
(!Serial);
12
}
13
14
void
loop
()
15
{
16
if
(button.
ischanged
()) {
17
Serial.print(button.
timestamp
());
18
Serial.print(
':'
);
19
Serial.println(button ? F(
"released"
) : F(
"pushed"
));
20
}
21
}
Software::Serial::begin
void begin(uint32_t baudrate)
Definition:
Serial.h:50
Button.h
Button
Definition:
Button.h:31
setup
void setup()
Definition:
Button.ino:8
Button::ischanged
bool ischanged()
Definition:
Button.h:50
button
Button< BOARD::D1 > button
Definition:
Button.ino:6
Serial.h
Serial
Software::Serial< BOARD::D0 > Serial
Definition:
Button.ino:5
loop
void loop()
Definition:
Button.ino:14
Software::Serial
Definition:
Serial.h:31
Button::timestamp
uint16_t timestamp()
Definition:
Button.h:86
examples
ATtiny
Button
Button.ino
Generated on Sat Oct 14 2017 16:03:22 for Arduino-GPIO by
1.8.11