Detects the average light level around the chip’s interface blocks. Any number of interface blocks can be used in different locations. When the clock input is triggered, the circuit will output the average light level relative to the number of output data bits used. Regarding no light as 0 and full daylight as the maximum number the data output bits can output. When one of the interface blocks’ faces are covered with another block, the light level will go down unless that block is part of the photocell circuit.

on Wikipedia

source code

I/O setup

Sign text

  1. photocell

Version history: Added to SensorLibrary 0.1

Fork me on GitHub