I have an issue with programming an Arduino Mega board.
Here's what I have: a light curtain(made of 2 phototransistors and 2 IR beams) and a 3 Degrees of freedom robot.
I want to condition the movements of the robot to the return of a logic "1" of the light curtain.
My question is...how can I create some sort of a sub-program that will return a 1 or 0 from the light curtain to my main program so that I could use it as a condition further in the program.
I have to mention I am a beginner in programming :|