Counter for I2C LCD with Color Sensor?

Is there a code for this anywhere?
Even a general one?