TI RSLK Library  0.2.0
Public Member Functions | List of all members
Bump_Switch Class Reference

Represents a single bump switch. More...

#include <Bump_Switch.h>

Public Member Functions

bool begin (uint8_t pin_num, uint8_t mode=INPUT_PULLUP)
 Initialize the bump switch class. More...
 
bool read ()
 Read the bump switch value. More...
 

Detailed Description

Represents a single bump switch.

An instance of this class represents a single Pololus bump switch. The function begin must be called before using any other function.

Definition at line 12 of file Bump_Switch.h.

Member Function Documentation

◆ begin()

bool Bump_Switch::begin ( uint8_t  pin_num,
uint8_t  mode = INPUT_PULLUP 
)

Initialize the bump switch class.

Parameters
[in]pin_numPin number on Launchpad connected to bump switch
[in]modefor input pin. Options are the same as standard Energia/Arduino pin mode.

This function needs to be called before any other function is used.

Definition at line 10 of file Bump_Switch.cpp.

◆ read()

bool Bump_Switch::read ( )

Read the bump switch value.

Returns
0 or 1. Value when button pressed or released depends on hardware connection and any pulldown/pullup (internal/external) resistors.

Definition at line 16 of file Bump_Switch.cpp.


The documentation for this class was generated from the following files: