TI RSLK Library
0.2.0
src
Bump_Switch.cpp
1
#include "Bump_Switch.h"
2
3
Bump_Switch::Bump_Switch()
4
{
5
configured =
false
;
6
num_pins = 0;
7
bump_sw_pin = 0;
8
}
9
10
bool
Bump_Switch::begin
(uint8_t pin_num, uint8_t mode) {
11
bump_sw_pin = pin_num;
12
pinMode(bump_sw_pin,mode);
13
return
true
;
14
}
15
16
bool
Bump_Switch::read
() {
17
return
digitalRead(bump_sw_pin);
18
}
Bump_Switch::read
bool read()
Read the bump switch value.
Definition:
Bump_Switch.cpp:16
Bump_Switch::begin
bool begin(uint8_t pin_num, uint8_t mode=INPUT_PULLUP)
Initialize the bump switch class.
Definition:
Bump_Switch.cpp:10
Generated by
1.8.16