Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved usability with Arduino IDE #1

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sainsmartkeypad
SainsmartKeypad
===============

More usable Version of the DFR_Key library for Sainsmart 1602 LCD Keypad. It's also usable for all other resistor based keypads. Make sure that you distribute your changes (GPLv3).
More usable Version of the DFR_Key library for Sainsmart 1602 LCD Keypad.
It's also usable for all other resistor based keypads.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#include <Arduino.h>
#include <LiquidCrystal.h>

#include "Arduino.h"

// github.com/Phaiax/sainsmartkeypad
#include "sainsmartkeypad.h"
#include <SainsmartKeypad.h>

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
SainsmartKeypad keypad(0);
Expand All @@ -14,20 +11,23 @@ void setup() {
lcd.begin(16, 2);
lcd.setCursor(0,0);
lcd.print("Keypad Example");

// set your own values, if necessary
//keypad.setAnalogReadValues(721, 482, 132, 309, 0, 1023);
}

void loop() {
key = keypad.getKey_fastscroll();

// Try the other possibilities:
// (Only one at a time.
// fastscroll, waitrelease and periodic
// won't work next to each other.)

//key = keypad.getKey_waitrelease(); // without fastscroll but usable
//key = keypad.getKey_periodic(); // not quite usable
//key = keypad.getKey_instant(); // not quite usable

if(key != SAMPLE_WAIT) // Do not refresh screen every loop
{
switch(key)
Expand All @@ -44,4 +44,3 @@ void loop() {
lcd.print(" ");
}
}

30 changes: 30 additions & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#######################################
# Syntax Coloring Map For ExampleLibrary
#######################################

#######################################
# Datatypes (KEYWORD1)
#######################################

SainsmartKeypad KEYWORD1

#######################################
# Methods and Functions (KEYWORD2)
#######################################

getKey_fastscroll KEYWORD2
getKey_waitrelease KEYWORD2
getKey_periodic KEYWORD2
getKey_instant KEYWORD2
setAnalogReadValues KEYWORD2
setRefreshRate KEYWORD2
setMsToActivateFastScroll KEYWORD2
setFastScrollTriggerRate KEYWORD2

#######################################
# Instances (KEYWORD2)
#######################################

#######################################
# Constants (LITERAL1)
#######################################
9 changes: 9 additions & 0 deletions library.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name=SainsmartKeypad
version=1.0.0-alpha
author=Simon Hitzenberger
maintainer=Simon Hitzenberger
sentence=More usable Version of the DFR_Key library for Sainsmart 1602 LCD Keypad.
paragraph=It's also usable for all other resistor based keypads.
category=Device Control
url=https://github.com/slh24/arduino-sainsmartkeypad
architectures=*
179 changes: 0 additions & 179 deletions sainsmartkeypad_example_sketch/sainsmartkeypad.cpp

This file was deleted.

Loading