diff --git a/Documentation/index.rst b/Documentation/index.rst index f850b08e35da948d938517e06337009d2c43041c..57c5b3d7d56847de6f2b56ed3e15ea7b56c864d8 100644 --- a/Documentation/index.rst +++ b/Documentation/index.rst @@ -24,6 +24,7 @@ Last but not least, if you want to start hacking the lower-level firmware, the pycardium/color pycardium/display pycardium/leds + pycardium/light-sensor pycardium/vibra .. toctree:: diff --git a/Documentation/pycardium/light-sensor.rst b/Documentation/pycardium/light-sensor.rst new file mode 100644 index 0000000000000000000000000000000000000000..f07df5cac6d17443c753493c1e92ae7f41487a2b --- /dev/null +++ b/Documentation/pycardium/light-sensor.rst @@ -0,0 +1,25 @@ +``light_sensor`` - Ambient Brightness +===================================== +On the harmonic board, there is an IR-LED which can be used in reverse as a +crude brightness sensor. Values returned are in no particular unit but seem to +be fairly stable. + +.. py:function:: light_sensor.start() + + Turn on the ADC and start reading brightness values. This function must be + called before any measurements can be taken. + +.. py:function:: light_sensor.get_reading() + + Get an ambient brightness reading. The returned value is in no particular + unit, though it seems to be fairly stable. Common values: + + - ~8: Very dark are + - ~17: Typical hackerspace brightness + - >200: Direct sunlight + + :returns: A brightness reading in no particular unit + +.. py:function:: light_sensor.stop() + + Stop the ADC.