HOW TO CONTROL THE RESET BUTTON OF THE ARDUINO BY PROGRAMMING WITHOUT PRESSING

Hi! Need help I want to create a passcode(buttons/switches) like program in which on typing the passcode the arduino will perform the program. But in case I press a wrong button/switch/digit I should be able to restart the program. Or is there any other way to clear the wrong pressed button/switch/digit.

And in general I would appreciate if someone would be able to tell me how to control the reset or restart(that is what I call it) switch/button. in the sketch/program.

Thanks!

Resetting or restarting the Arduino would be using a sledgehammer when a gentle tickle would do.

Can you please provide an example of the program that is causing the problem as there may be many ways to solve it.

I did not get you first line.........and I want to type a passcode to unlock the program using dtmf decoder and to lock it again. And in case I press the wrong digit, how do I press the backspace key(by pressing #).

and I want to type a passcode to unlock the program using dtmf decoder and to lock it again. And in case I press the wrong digit, how do I press the backspace key(by pressing #).

Type a passcode using what? If you can type a passcode, why can’t you type a backspace?

If you can recognize, in the code you haven’t posted, a valid passcode, why can’t you recognize a backspace character?

Type a passcode using what? If you can type a passcode, why can't you type a backspace?

If you can recognize, in the code you haven't posted, a valid passcode, why can't you recognize a backspace character?

Well I am thinking of the program as(a,b,c,d are the four binary digits, and the code is 1111):-

void loop()
{
if((a==0)&&(b==0)&&(c==0)&&(d==1))
{
 if((a==0)&&(b==0)&&(c==0)&&(d==1))
{
if((a==0)&&(b==0)&&(c==0)&&(d==1))
{
if((a==0)&&(b==0)&&(c==0)&&(d==1))
{"my code here"
}
}
}
}
}

My code will only work if I press all the four digits in correct succession. Any help if the code is wrong and how can I type the 2nd digit again in case I write it wrong.

And how to restart the program i.e. lock it.

how can I type the 2nd digit again in case I write it wrong.

I mean any digit

Well I am thinking of the program as(a,b,c,d are the four binary digits, and the code is 1111):-

Well, I’m thinking that that’s silly. If a, b, and c are 0, and d is 1, what are the odds that the second if statement will be false? The third? The 4th?

I mean any digit

You still haven’t defined what you are typing these digits on, and you haven’t posted any code, so only you can answer that question.

Typically, you’d store all the characters in an array, as they are entered, unless the character is a special character, like enter or backspace. If the character IS enter, you do something with the stored data. If the character IS the backspace, you replace the last character in the array with a NULL and decrement the index.

You still haven't defined what you are typing these digits on, and you haven't posted any code, so only you can answer that question.

Typically, you'd store all the characters in an array, as they are entered, unless the character is a special character, like enter or backspace. If the character IS enter, you do something with the stored data. If the character IS the backspace, you replace the last character in the array with a NULL and decrement the index.

I have told that. I am typing it on a phone and it is being decoded by a dtmf decoder. And I think you have solved my problem partially. Can you also give the code with a little explanation if it is a complex one, since I am a beginner.

void loop()
{
if((a==0)&&(b==0)&&(c==0)&&(d==1))
{
 if((a==0)&&(b==0)&&(c==0)&&(d==1))
{
if((a==0)&&(b==0)&&(c==0)&&(d==1))
{
if((a==0)&&(b==0)&&(c==0)&&(d==1))
{"my code here"
}
}
}
}
}
sketch_oct06a.ino: In function 'void loop()':
sketch_oct06a:3: error: 'a' was not declared in this scope
sketch_oct06a:3: error: 'b' was not declared in this scope
sketch_oct06a:3: error: 'c' was not declared in this scope
sketch_oct06a:3: error: 'd' was not declared in this scope
sketch_oct06a:11: error: expected `;' before '}' token

Why don't you post your actual code, and we can help you fix it?

Can you also give the code with a little explanation if it is a complex one, since I am a beginner.

You first. Where is your code?

I haven't yet made the code. I need help to make it. Does anyone know a way to secure a program by a passcode and also lock it.

I just want the outline of passcode protecting it. I don't want the entire code.

I haven't yet made the code.

And yet you claim to be getting data from DTMF pulses sent by a phone. Are you, or aren't you?

I know how to collect data from dtmf but I dont know how to use it as a passcode

My code will only work if I press all the four digits in correct succession

let me get this straight - the code you haven't written yet behaves like this?

sayam_sethi: I know how to collect data from dtmf but I dont know how to use it as a passcode

As a first step how about you post your program that collects data from dtmf ?

Well you are moving away from the topic........I had asked how to control the reset switch on the arduino board by a code in the script.

I had asked how to control the reset switch on the arduino board by a code in the script.

A) You can't. B) You don't need to.

I had asked how to control the reset switch on the arduino board by a code in the script.

And we've told you to fix the problem that makes you think that that is what you need to do.

I need to