QRD1114 Light Intenstiy

Hello everyone I'm new to this forum and new to coding. I am to write a code that utilizes the QRD1114 light intensity sensor to sort black and white 3/8" diameter balls. Can someone point me in the right direction as to how would I go about writing the code?

Start with the examples in the IDE. 01.Basics, such as Blink and DigitalReadSerial. Combine them, change them with your assignment in mind. Move on to DigitalInputPullup and StateChangeDetection in 02.Digital.

Try something, and when you are stumped, come back and post your code.