Skip to content

This library allows an Aduino board to interface with a 5 button ADKeyboard with minimal boiler plate code.

License

Notifications You must be signed in to change notification settings

sjcrookes/Arduino-ADKeyboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ADKeyboard Library for Arduino

This library allows an Aduino board to interface with a 5 button ADKeyboard with minimal boiler plate code.

Installation

Download this repo as a ZIP, and use the Arduino IDE to import it

  • Sketch > Include Library > Add .ZIP Library

Usage

// Include the library
#include <ADKeyboard.h>

// Create a new keyboard instance passing the analog pin that the OUT pin on the ADKeyboard device is connected to. EG: A0
ADKeyboard kb(A0);

// Get which pin was pressed 1..5, or 0 for no press
int pressed = kb.pressed();

// Alternative usage, pass a pin and check the result, if it was pressed then returns true
bool btn1_pressed = kb.pressed(1);

// Alternative, direct usage, pass a pin and get which pin was pressed 1..5, or 0 for no press, EG: A0
int pressed = ADKeyboardState(A0);

Example

Use the Arduino IDE to open the supplied example code.

  • File > Examples > ADKeyboard > example1

License

Copyright (c) Arduino LLC. All right reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

About

This library allows an Aduino board to interface with a 5 button ADKeyboard with minimal boiler plate code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages