Hi, i'm very new to arduino and coding, and i'm really struggling with being able to define the length of passcode from within my sketch.
basically, the length seems to be fixed to however many digits i have in the char* line. I can change the secret code, write and load it to and from the EEPROM, but if i only write a 4 digit code it will still need the other 2 (5 and 6) to get the correct code.
char* secretCode = "123456";
Password password = secretCode;
if i change to
char* secretCode = "12345";
Password password = secretCode;
then a user defined 5 digit code will work.
is it possible to make the amount of digits in the password variable and dependent on how many are selected when choosing a new code? would i still use the char* function? or am i looking in the wrong place completely?
i haven't posted my sketch up as i don't know if you need to see it, or even want to see it, heh. i'm just after a little direction as i've been stuck on this a bit too long now, am going around in circles, and just when i think i have thought things through to some kind of resolution, the missus shouts through with various tasks that she'd like me to get on with, and i lose track of where i am/was.
could someone please give us a kick in the right direction?
if the code needs posting, i'll put it up if you promise not to laugh too much ;]