Author Topic: arduino keypad help needed!  (Read 2891 times)

0 Members and 1 Guest are viewing this topic.

Offline blackjames

  • Regular Contributor
  • *
  • Posts: 78
arduino keypad help needed!
« on: August 02, 2012, 09:14:36 am »
hi, recently i downloaded the arduino keypad library, and opened one of the example sketches. for some reason, the IDE doesnt approve the program when i press "verify". does anyone know why this happens.

here is the program:

#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'#','0','*'}
};
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){
  Serial.begin(9600);
}

void loop(){
  char key = keypad.getKey();

  if (key != NO_KEY){
    Serial.println(key);
  }
}
 

Offline dda

  • Contributor
  • Posts: 46
  • Country: au
Re: arduino keypad help needed!
« Reply #1 on: August 02, 2012, 09:32:12 am »
It compiles fine for me (Arduino 1.0.1). Is the Keypad folder in the libraries folder?
 

Offline blackjames

  • Regular Contributor
  • *
  • Posts: 78
Re: arduino keypad help needed!
« Reply #2 on: August 02, 2012, 09:37:09 am »
i think it dosent work because i have arduino 1.0, and it is in the libraries folder.
 

Offline Chet T16

  • Frequent Contributor
  • **
  • Posts: 530
  • Country: ie
    • Retro-Renault
Re: arduino keypad help needed!
« Reply #3 on: August 02, 2012, 09:59:29 am »
What error?
Chet
Paid Electron Wrestler
 

Offline bsiswoyo

  • Contributor
  • Posts: 7
  • Country: id
    • Bambang Siswoyo
Re: arduino keypad help needed!
« Reply #4 on: August 09, 2012, 12:57:32 am »
To create keypad for easy, use adc of ATmega on arduino.
Visit: http://bsiswoyo.lecture.ub.ac.id/2012/02/keypad-using-adc-a-microcontroller-application/

Best regard
Bambang Siswoyo

 
hi, recently i downloaded the arduino keypad library, and opened one of the example sketches. for some reason, the IDE doesnt approve the program when i press "verify". does anyone know why this happens.

here is the program:

#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'#','0','*'}
};
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){
  Serial.begin(9600);
}

void loop(){
  char key = keypad.getKey();

  if (key != NO_KEY){
    Serial.println(key);
  }
}
Bambang Siswoyo
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf