PDA

View Full Version : pic16F628



ilham M
- 7th May 2009, 22:35
hi every one
can any one help me with this... plzzzzzzzz
i use Pic16F628 for a senior project and i want to know how to write a code for store 2 dimensional array and how to compare two regular array ??
i use pro picbasic .

thanks in advance :)

ScaleRobotics
- 8th May 2009, 07:34
Hello Ilham,

You might have to tell the rest of us a little more about what you are trying to do. As far as multidimensional arrays, I did a search and found this thread:

http://www.picbasic.co.uk/forum/showthread.php?p=32093#post32093

ilham M
- 9th May 2009, 00:54
hello scalerobotics
I'm a Beginner in this field ,
we are trying to make an electronic wallet by using this Pic
and we want to programmed it to be open with a password
so we want to set the password in array to make a comparison with the enter password by user in order to check if it correct or not
i hope i make it much clear :)

ScaleRobotics
- 9th May 2009, 02:22
Ok, that makes sense. I think you could do it simply by making two arrays, and comparing their contents. You might want more bytes if you need it more secure. You could do it this way:




passkeyed var byte[6] 'entered (keyed) password
passcode var byte[6] 'stored pass word

for n = 0 to 5
if passkeyed[n] != passcode[n] then failure 'if passkeyed[n] does not equal passcode[n]
next n
'if passkeyed passes, your program will get here

end

failure: 'failure subroutine here
'get here only if you failed password entry
return

aratti
- 9th May 2009, 06:18
Go to the following thread : http://www.picbasic.co.uk/forum/showthread.php?t=10637

You will find the code for different examples. In post#9 you will find my working snippet for an entry password.

Al.

ilham M
- 9th May 2009, 23:33
thanxxxxxxx so much :D