04-23-2015 09:30 AM
Hi forum!
I have a school-assigment to next week and Im struggeling with the idea on how to make a 4 digit code-lock with a possebility to change the code with a master code.
Im using a hardware keypad with 10 digits (0-9).
Can anybody please help me with this?
Apologyse for my English
Thanks
04-23-2015 09:40 AM
Think about all the steps involved in what you want to do.
You need 4 inputs, 1 for each digit
You could use a button to check if the code is correct
Something that says if the code is good or bad
A button to change the code
...
...
...
Start with that and see how far you get. Then think about how you can program it. Start programming. When/if you get stuck post your code and explain the problem you are having.
04-23-2015 12:32 PM
The first issue is getting your keypad values. That will likely be done with a digital port. But you will want a VI that does nothing but read the keypad.
From there, I'm picturing having a loop that just reads the keypad and adds the read digit (when there is one) to a string. After 4 numbers, check the keypad and react accordingly.
04-23-2015 12:34 PM
Guess I just blew right past the hardware.....
04-23-2015 07:03 PM
04-28-2015 03:15 AM
So here is what I got so far.
Just found out that I dont have to set the mastercode on hardware side, but I can use software to set the mastercode.
Need to be pointed in the right direction, any suggestions or tweaks you guys can point me in?
04-28-2015 07:21 AM
How do you know when you can read the port digital IO? Where is the loop? You will need a shift register to keep the previous numbers in and then compare that to the combination once enough numbers have been entered.
I don't have the myRIO stuff installed right now, but you should be able to just read the A port in its entirety as a number. That would make things a lot cleaner and simpler for you.
05-05-2015 09:29 AM
So, I've made this out of the assignment. But I need a sequense of the numbers so I dont need to push everything in at once. And tips or modification you peaople can help me achive this?
Best regards