Skip to content
Browse files

Simple documention in BasicRead example

Removed Serial from BasicRead example
  • Loading branch information...
1 parent b368ee1 commit cf8250861bbea36cc14b188fe164063a3854515b @netmaniac committed Mar 9, 2011
Showing with 38 additions and 7 deletions.
  1. +1 −0 .gitignore
  2. +33 −7 Examples/BasicRead/BasicRead.pde
  3. +4 −0 README
View
1 .gitignore
@@ -1 +1,2 @@
*~
+netbeans/*
View
40 Examples/BasicRead/BasicRead.pde
@@ -1,3 +1,30 @@
+/*
+Example how to read selected key from Nettigo Keypad.
+
+Uses:
+ - Arduino
+ - LCD Kit from Nettigo (but could be any LCD display compatible with LiquidCrystal library)
+ - Nettigo Keypad
+
+ Connect:
+ LCD:
+ 1 - GND
+ 2 - +5V
+ 3 - 10k pot output
+ 4 - D2 on Arduino
+ 5 - GND
+ 6 - D3 on Arduino
+ 7 - 10 - not connected
+ 11 - 14 - D4-D7 on Arduino
+ 15 - +5V (backlight)
+ 16 - GND
+
+ Nettigo Keypad:
+ AD1:
+ 1 (marked with square pad) - +5V
+ 2 - A0 on Arduino
+ 3 - GND
+*/
#include <NettigoKeypad.h>
#include <LiquidCrystal.h>
@@ -6,19 +33,18 @@ LiquidCrystal lcd(2,3,4,5,6,7);
NG_Keypad keypad;
+char* keys[] = { "NONE", "SELECT", "LEFT", "DOWN", "UP", "RIGHT" };
+
void setup(){
- Serial.begin(9600);
lcd.begin(16,2);
- lcd.print("hello, world!");
-
+ lcd.print("Selected key:");
}
void loop(){
int rd;
rd = analogRead(0);
- Serial.println(rd , DEC);
lcd.setCursor(0,1);
- lcd.print(keypad.key_pressed(rd),DEC);
- lcd.print(" ");
- delay(1000);
+ lcd.print( keys[ keypad.key_pressed(rd) ] );
+ lcd.print(" ");
+ delay(100);
}
View
4 README
@@ -4,3 +4,7 @@ input.
Sold by Nettigo:
http://nettigo.pl/product/Nettigo-Keypad---odczyt-przez-wejscie-analogowe,keypad
+
+History:
+
+2011-03-08: First version

0 comments on commit cf82508

Please sign in to comment.
Something went wrong with that request. Please try again.