Kinetic Sculpture  3.1
Software to Architecture for the Junior Kinetic Sculpture Project
 All Classes Files Functions Variables Macros Pages
Public Member Functions | List of all members
Switch Class Reference

#include <Switch.h>

Public Member Functions

 Switch (int pin)
 
void setupSwitch ()
 
byte getState ()
 

Detailed Description

Class to interface with the switches on the PCB board. These switches are user toggled to define which mode the Kinetic Sculpture will be in.

Written by Wade Varesio 9/21/2018

Constructor & Destructor Documentation

Switch::Switch ( int  pin)
inline

Constructor for declaring a switch on the PCB.

Parameters
pinpin that the switch is attached to.

Member Function Documentation

void Switch::setupSwitch ( )
inline

Sets up the switch

Sets the pin mode on the switch to be INPUT_PULLUP which allows for reading of the switch without a dedicated resistor

byte Switch::getState ( )
inline

Call to get the state of the switch which is either HIGH (switch toggled up towards top of PCB) or vice versa

Returns
digitalRead on the switch pin

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