so I am trying to get the arduino to read a 12-13.8v signal through an optocoupler, I know the optocoupler works as i can get it to turn on/off an LED withouth the arduino. however When I try to get the arduino to read a high/low from the optocoupler output cuircut and power pin 4 when high and not when low, the led just remains iluminated. here is my code and following that is how i have wired the optocoupler;
int optoInput = 7;
int grnLed = 4;
if (digitalRead(optoInput) == HIGH)
What am I doing wrong?