Show Posts
Pages: 1 2 [3]
31  Using Arduino / Project Guidance / Re: Keypad and resistors on: March 17, 2011, 05:52:44 pm
Yes, I understand that first part. But I don't actually understand, how to connect keypad with power and etc. Could you show me how to connect everying using this my image quikly made by paint, please?

http://img857.imageshack.us/i/68787107.jpg/
32  Using Arduino / Project Guidance / Re: Keypad and resistors on: March 17, 2011, 05:23:26 pm
Thanks, for quick replay!

I just need to connect my keypad to work properly smiley I have already identified my keypad cols and rows pins, but I don't know, where to put resistors while connecting keypad to my arduino. I want to connect each pin of the rows and each pin of the columns to arduino. So, where I have to connect resistors?

There http://www.arduino.cc/playground/Main/KeypadTutorial it is said, that I will need resistors 2k to 10k, on each of the row pins. So, how to do this? this resistors should be between wire whitch is coming from keypad to arduino or that resistors should be on ground pin?
33  Using Arduino / Project Guidance / Keypad and resistors on: March 17, 2011, 05:07:52 pm
Hello. I have one more question about keypad. I have standart 3x4(3 cols, 4 rows) keypad. Where I have to connect resistors while connecting keypad with my arduino board?

Thanks for answering, everyone!

Simas 
 
 
 
34  Using Arduino / Project Guidance / Re: Start with keypad and password on: March 08, 2011, 05:01:36 pm
I have the keypad, but my arduino board is on it's way, so I have some time for code. You right, brucethehoon, I am writing and debugging my code.  I am trying to find out, did I correctly understand all functions and etc. So, I am just asking some corrections or advises from professionals, if something is wrong with my code.

35  Using Arduino / Project Guidance / Re: Start with keypad and password on: March 08, 2011, 03:43:30 am
Can any one help, please? smiley
36  Using Arduino / Project Guidance / Re: Start with keypad and password on: March 06, 2011, 04:53:17 pm
I wrote a code and I need some corrections, if they are necessary. So, If I am right, this code should do just like that: the true password is 1234, I write ' * ' then I can guess a password, if it's wrong, the LED won't turn on and it will reset, if I write 1234, the LED will turn on. Am I right? Please, correct me, if it's necessary smiley

Code:
#include <Password.h>
#include <Keypad.h>

Password password = Password( "1234" );

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 );

const byte ledPin = 13;

void setup(){
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  digitalWrite(ledPin, HIGH);   // sets the LED on
  Serial.begin(9600);
  keypad.addEventListener(keypadEvent); //add an event listener for this keypad
}
 
void loop(){
  keypad.getKey();
}

//take care of some special events
void keypadEvent(KeypadEvent eKey)
{
  switch (eKey){
    case '*': guessPassword(); break;
    case '#': password.reset(); break;
default:
password.append(eKey);
  }
}

void guessPassword()
{
if (password.evaluate())
{
digitalWrite(ledPin,HIGH);
}else{
digitalWrite(ledPin,LOW);
}
}
37  Using Arduino / Project Guidance / Re: Start with keypad and password on: March 06, 2011, 04:43:14 pm
Thank you, Groove smiley
38  Using Arduino / Project Guidance / Re: Start with keypad and password on: March 06, 2011, 01:41:01 pm
One more question. Is it necessary to setDebounceTime for this situacion, which I am in?
39  Using Arduino / Project Guidance / Re: Start with keypad and password on: March 06, 2011, 01:22:20 pm
Thank you guys!
40  Using Arduino / Project Guidance / Re: Start with keypad and password on: March 06, 2011, 11:20:02 am
I read everything before and used and example and then I got and and error on row  -  Keypad keypad = Keypad(rowPins,colPins,rows,cols);

An error: PasswordKeypad:25: error: no matching function for call to 'Keypad::Keypad(byte [4], byte [4], byte&, byte&)'
C:\Users\Simas\Desktop\Arduino\libraries\Keypad/Keypad.h:63: note: candidates are: Keypad::Keypad(char*, byte*, byte*, byte, byte)
C:\Users\Simas\Desktop\Arduino\libraries\Keypad/Keypad.h:57: note:                 Keypad::Keypad(const Keypad&)



/*
||
|| @file PasswordKeypad.pde
|| @version 1.0
|| @author Alexander Brevig
|| @contact alexanderbrevig@gmail.com
||
|| @description
|| | A simple password application that uses a keypad as input source.
|| #
||
*/

//http://www.arduino.cc/playground/uploads/Code/Password.zip
#include <Password.h>
//http://www.arduino.cc/playground/uploads/Code/Keypad.zip
#include <Keypad.h>

Password password = Password( "1234" );

byte rows = 4; //four rows
byte cols = 4; //four columns
byte rowPins[] = {2,3,4,5}; //connect to the row pinouts of the keypad
byte colPins[] = {6,7,8,9}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad(rowPins,colPins,rows,cols);

const byte ledPin = 13;

void setup(){
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  digitalWrite(ledPin, HIGH);   // sets the LED on
  Serial.begin(9600);
  keypad.addEventListener(keypadEvent); //add an event listener for this keypad
}
 
void loop(){
  keypad.getKey();
}

//take care of some special events
void keypadEvent(KeypadEvent eKey){
  switch (eKey){
    case '*': guessPassword(); break;
    case '#': password.reset(); break;
   default:
      password.append(eKey);
  }
}


void guessPassword(){
   if (password.evaluate()){
      digitalWrite(ledPin,HIGH);
   }else{
      digitalWrite(ledPin,LOW);
   }
}






What's wrong?
41  Using Arduino / Project Guidance / Start with keypad and password on: March 06, 2011, 10:39:11 am
Hello. i'm working on project with simple keypad (just like this http://arduino.cc/playground/uploads/Main/16buttonkeypad.jpg). I'm trying to do like that: enter correct password which turn blue led on. If password incorrect turn red led on. From where should I start?

Thanks for answering.

Simas
Pages: 1 2 [3]