well... i just get started with arduino.. the tools i use is....
Hardware:Arduino duemilanove& Arduino LCD&KeyPad Shield
Software:arduino-0018 addon a libraries LCD4Bit
i was just using the example code... but come out a error.. and i dunno how to fix it ;D can any expert lend a hand?
============================================
#include <LCD4Bit.h>
LCD4Bit lcd = LCD4Bit_(2)
char msgs [5][15] = {"Right Key OK ",
"Up Key OK ",
"Down Key OK ",
"Left Key OK ",
"Select Key OK ",
int adc_key_val[5] ={30, 150, 360, 535, 760 };
int NUM_KEYS = 5;
int adc_key_in;
int key=-1;
int oldkey=-1;
int setup () {
pinMode(13,OUTPUT);
lcd.init();
lcd.clear();
lcd.printIn("KEYPAD testing... pressing");
}
void loop()
{
adc_key_in = analogRead(0)
digitalWrite(13, HIGH);
key = get_key(adc_key_in);
if (key != oldkey)
{
delay(50);
adc_key_in = analogRead(0);
key = get_key(adc_key_in);
if (key != oldkey)
{
oldkey = key;
if (key >=0){
lcd.cursorTo(2, 0);
lcd.printIn(msgs[key]);
}
}
}
digitalWrite(13,LOW);
}