Grayscale Sensor ================= This sensor is used to detect the light density and reflect the analog voltage signal back. So it can be used to detect black and white colors. Below is an example of some material light density. .. image:: Images/grayscalesensor-refractionindex.jpg :align: center | .. warning:: Before proceeding with this sensor, you will need to learn about the :ref:`mcpadc`. Connecting the Sensor ---------------------- The grayscale sensor is an analog sensor and cannot be connected directly to the Raspberry Pi pins. It needs an analog to digital converter, :ref:`mcpadc` in this case, in order to collect proper data. .. image:: Circuits/grayscalesensor.jpg :align: center Python Program to Get Readings ------------------------------- .. literalinclude:: Code/grayscalesensor.py :linenos: :language: python