Need for pull-down resistor

0

I am using the attachInterrupt() function in Arduino Uno to recognize the end of stroke of an actuator. Usually the test is used with if() , however the actuator cycle is very fast and the recognition by this means becomes complicated. With this I opted to use attachInterrupt() , however I do not know if in the case of interruption I should use a pull-down resistor at the input. Could anyone tell me if he has this need?

Currently the system looks like the image.

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;
}
    
asked by anonymous 22.08.2017 / 20:14

1 answer

0

Look, I can not comment because I have to have 50 points, and this is not the answer, but I advise you to post your question here that has a more targeted staff: link

    
23.08.2017 / 12:13