If you are good a programing please help!!!
Ok so i am building a marble sorter and our basic design is a light sensor (digital1) that reads weather the marble is black or clear then sorts it accordingly into one of 2 cups. The light sensor is on ramp in which the marble slides down and is stopped by a wheel (motor port 3) so it can be read. once the light sensor reads the number the wheel turns and allows only that ONE marble to pass through it. the rest of the marbles are fed one by one in this fashion. As this is happening the two cups that are below it are attached on a pate across from each other which turns by a motor in the center (motor port 4). The motor has an encoder (in11) that the drive shaft passes through so that it knows how how far to turn to catch the marble. when the marble rolls down (say it is a clear one) the cups turn to allow it to fall in the left cup. If the marble is black, the cups turn and the right cup catch it, then they return to there starting positions. The problem i am having is to get the motor that controls the cups to listen to the encoder and only turn a specified about when the light sensor reads the the marble. the whole process works in a this happens then this happens then this happens then it resets and does the whole thing again forever. The wheel is connected to a motor and it should turn to allow only one marble through at a time so the light sensor has a chance can read it.
I know this is really confusing but if you have any questions either post them or text me at :713 825 5818 you can also call between 2:10 & 3:00.
What i am asking is for someone who knows there good at programing to post how to do this (like post the code not just say how to do it). Thank you soooo much !!!!