Marble Sorter Code HELP US PLEASE

We are in need of help. We need someone to help us code a marble sorter with PLTW coding language. We have it built and have a plan for the code, but just don’t know anything about writing it. The marbles go through the hopper, a spiked wheel turns 1/6 of a rotation to let one through at a time, and they each go into a container where they are scanned by a flashlight. A sensor then reads a light value to determine the material of the marble. Then, a gear below with three containers rotates either 1/3 or 2/3 of a rotation depending on the marble type. The scanning container then has another spiked wheel that turns 1/6 a rotation to drop the marble into the appropriate cup. Then the cups need to reset and another marble has to be allowed through the first gate. PLEASE HELP US PLEASE

1 Like

If you have in mind RobotC flavor of C, then there are quite a few YouTube videos on this subject, which can help you get started and program basic motor and sensor operations.

For example, this video tutorial:

If you search this forum for marble sorter examples, you will find a number of topics that discuss dependence of light sensor results on external lighting conditions.

There are two common ways to resolve this: either enclose light source, light sensor, and scanned marble in the non-transparent box for the predictable light level, or have two light sensors: one scanning sorted marble and another scanning reference marble of a known material/color affixed to sorting mechanism so that you can reliably compare them under wide variety of external lighting conditions.

Unless you have a vex servo, which can turn to specific position using its internal position sensor, you will need an external sensor like potentiometer or a combination of button/limit switch and rotation/quadrature encoder to reliably tell current sorter position.

Alternatively this function could be performed by the second light sensor that scans sample marbles affixed to the sorter in the position corresponding to current bin.

2 Likes