Skip to content

Simple interface for getting the current pressed button on Industruino.

Notifications You must be signed in to change notification settings

summitsystemsinc/IndIOButtonPanel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

IndIOButtonPanel

Simple Arduino library for reading the button states on an Industruino.

Installation

See: Arduino Library docs

Either download the zip of the repository and install through the Arduino IDE, or do a manual install with a git checkout.

Usage

IndIOButtonPanel btns;

int lastButton;
int currentButton;

void setup() {
    btns = IndIOButtonPanel();
    lastButton = NONE_PRESSED;
    currentButton = NONE_PRESSED;
}

void loop() {
    currentButton = btns.readButtonPanel();
    if(currentButton != lastButton){
        //Do something with the button press.
    }
}

Variables

There are a couple of constants defined for help:

const int ENTER_PRESSED = 1;
const int UP_PRESSED = 2;
const int DOWN_PRESSED = 3;
const int NONE_PRESSED = 0;

Functions

int readButtonPanel(); //Returns 0-3, noted above.

NOTE With the current logic, sometimes UP + DOWN yields an ENTER being pressed.

About

Simple interface for getting the current pressed button on Industruino.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages