Pages: [1]   Go Down
Author Topic: reprogramable password  (Read 367 times)
0 Members and 1 Guest are viewing this topic.
Bethlehem, PA
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am new to arduino but I am looking to create a coded garage door opener but instead of having to hook it up to a computer every time I want to change the password, I want to e able to do it from the keypad. I know that eeprom is available but it is only capable of handling up to a 255 value. and that would be fine if I only wanted to use a 3 digit pin but honestly who only uses 3 digits? I am looking to store any amount of digits that I would want to use at any given time.
« Last Edit: February 24, 2013, 06:20:45 am by redwind » Logged

East Anglia (UK)
Offline Offline
Faraday Member
**
Karma: 89
Posts: 3453
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Bearing in mind that this is the Programming Questions section of the forum, what is your question ?

You don't store the password as a single number, you store it as a series of single digits.
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

UK
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3969
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The EEPROM can store a value between 0 and 255 in each of its memory locations.

Typically it has 1024 EEPROM memory locations.

I mean, seriously, who uses a 1024 digit PIN?  smiley-wink

You store the first number (1) in EEPROM memory location 0.
You store the second number (0) in EEPROM memory location 1.
You store the third number (6) in EEPROM memory location 2.
You store the third number (6) in EEPROM memory location 3.

etc.
Logged

Why not visit my eBay shop? http://stores.ebay.co.uk/Majenko-Technologies
Replacement for the Arduino IDE: UECIDE - Proper serial terminal, graphing facilities, plugins, overhauled internals.
Java isn't bad in itself, but it has enabled morons to write programs.

Bethlehem, PA
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

my question is how to go about storing a larger number. but from what I am understanding from what your saying is that instead of using a sing int I should use multiple int

ex:
int p1 = 1
int p2 = 2
int p3 = 3
int p4 = 4

instead of
int p = 1234
Logged

East Anglia (UK)
Offline Offline
Faraday Member
**
Karma: 89
Posts: 3453
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, or better, put the password in an array.
Code:
int password[] = {'1','2','3','4'};
This makes it very much easier to refer to each number without repeating code.
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

UK
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3969
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, or better, put the password in an array.
Code:
int password[] = {'1','2','3','4'};
This makes it very much easier to refer to each number without repeating code.
Don't use int's.  The Arduino is an 8 bit machine.  Using ints to store a small value (<256) is incredibly inefficient and wasteful.

You should use byte.
Logged

Why not visit my eBay shop? http://stores.ebay.co.uk/Majenko-Technologies
Replacement for the Arduino IDE: UECIDE - Proper serial terminal, graphing facilities, plugins, overhauled internals.
Java isn't bad in itself, but it has enabled morons to write programs.

East Anglia (UK)
Offline Offline
Faraday Member
**
Karma: 89
Posts: 3453
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quite right !
int almost types itself.  Bad habit.
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Pages: [1]   Go Up
Jump to: