hi to all,
I have a code which is working in loop section. I want to add a interrupt to it. I have a LDR sensor which have digital output connected to digital pin2. when the output is high the code in loop will stop and motor will turn untill the ldr sensor’s output low.
I tried to add the this simple code but when the ldr output change motor takes just one step and stop. it doesnt continue to turn untill the output low.
I will be happy if someone help me about the code.
AccelStepper stepper1(1, 6, 5);
attachInterrupt(0, Motor, CHANGE);