Go Down

Topic: HOW TO CONTROL THE RESET BUTTON OF THE ARDUINO BY PROGRAMMING WITHOUT PRESSING (Read 5333 times) previous topic - next topic

UKHeliBob

Can I suggest that you first write a program on the Arduino that receives the dtmf values and writes them to the Serial monitor ?  Then we can give advice on how to store them and compare them with the unlock code.
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

sayam_sethi

Well I want to know how to do this:-
Quote
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.

AWOL

So, we're in the Programming section, we're at reply #32 and we still haven't seen your code.
Is this a Project Advice question or Gigs and Collaborations?

PaulS

Quote
Well I want to know how to do this:-

Code: [Select]

char denseUser[20];
byte pointless = 0;

void loop()
{
    char someCrap = getDTMFTone();
    switch(someCrap)
    {
        case '#':
           if(pointless >= 0)
           {
              denseUser[pointless] = '\0';
              pointless--;
           }
           break;

        case '*':
           // Do something with the data on denseUser;
           pointless = 0;
           denseUser[pointless] = '\0';
           break;

        default:
           if(pointless < 19)
           {
              denseUser[pointless++] = someCrap;
              denseUser[pointless] = '\0';
           }
           break;
   }
}
The art of getting good answers lies in asking good questions.


sayam_sethi

Code: [Select]

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))
{
if((a==0)&&(b==0)&&(c==0)&&(d==1))
{
//my program here
}
}
}
}
}


you all would be knowing hoe to declare four digital pins as input and naming their input values as a, b, c, d.
the passcode here is 1111.
what I want to know is how to go back from the 3rd "if" statement to the 2nd "if" statement


PaulS

Quote
what I want to know is how to go back from the 3rd "if" statement to the 2nd "if" statement

Why do you think you need to? If the 3rd if statement is false, loop() will and, and be called again. If there is something in the code you haven't posted that changes the values of a, b, c, and d, then, next time around, presumably they will contain different values.

Quote
Well I didnt get u

Nothing I can do about that. I guess that the array name was well chosen.
The art of getting good answers lies in asking good questions.

sayam_sethi

So you mean to say that if the statement is false then the loop will start again?????

AWOL

Quote
what I want to know is how to go back from the 3rd "if" statement to the 2nd "if" statement

I think it is time you put this idea on the shelf, and took some time to work through some of the programming examples provided in the IDE.



sayam_sethi




Go Up