Need pull-down resistor

Asked

Viewed 84 times

0

I’m using the function attachInterrupt() in the Arduino Uno to recognize the end of a course of an actuator. Normally test is used with if(), but the actuator cycle is very fast and the recognition by this means becomes complicated. With this I chose to use attachInterrupt(), however I do not know if in the case of interruption I should use pull-down resistor in the input. Someone would know me if you have this need?

Currently the system is as in the image.Sistema atual

Piece of code:

attachInterrupt(digitalPinToInterrupt(interruptPin2), EndCourse2, FALLING);
attachInterrupt(digitalPinToInterrupt(interruptPin3), EndCourse3, FALLING);

void EndCourse2()
{
    digitalWrite(12,LOW);
    btnpressed2=0;
}
void EndCourse3()
{
    if(btnpressed2==0)
    {
    digitalWrite(12,HIGH);
    CounterAT2++;
    }
    btnpressed2=1;
}

1 answer

0

Look I can not comment because I have to have 50 points, and also this is not the answer, but I advise you to post your doubt here that has a more directed staff: https://arduino.stackexchange.com/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.