OPTOCOUPLER

I am a beginner in Arduino and have a project with an optocoupler 4N25!
the project is to connect a led through the coupler! just that my teacher wants to know if the arduino can store the state of the coupler!
only that I have a lot of doubts!
I did so:

// declaração das variáveis
int led = 13;
int acoplador = A0;

void setup () {
pinMode (led, OUTPUT);
pinMode (acoplador, INPUT);
}

void loop () {

if (acoplador = HIGH){
digitalWrite (led, HIGH);
}
else {
digitalWrite (led, LOW);
}
}

??
Duplicares o post resolve o teu problema???

eu não estou a exprimir bem a situação!

eu não estou a exprimir bem a situação!

Ok e então duplicares o post com o mesmo texto ajuda?
Eu respondi-te no teu post anterior