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