mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
api/nxtdevices: add Light Sensor
This commit is contained in:
@@ -30,3 +30,7 @@ NXT Touch Sensor
|
||||
from pybricks.nxtdevices import TouchSensor
|
||||
from pybricks.parameters import Port
|
||||
my_sensor = TouchSensor(Port.S1, verify_type=False)
|
||||
|
||||
NXT Light Sensor
|
||||
^^^^^^^^^^^^^^^^
|
||||
.. autoclass:: pybricks.nxtdevices.LightSensor
|
||||
|
||||
@@ -21,3 +21,35 @@ class TouchSensor():
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class LightSensor():
|
||||
"""LEGO® MINDSTORMS® NXT Color Sensor."""
|
||||
|
||||
def __init__(self, port):
|
||||
"""
|
||||
|
||||
Arguments:
|
||||
port (Port): Port to which the sensor is connected.
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
def ambient(self):
|
||||
"""Measure the ambient light intensity.
|
||||
|
||||
Returns:
|
||||
:ref:`percentage`: Ambient light intensity, ranging from 0 (dark)
|
||||
to 100 (bright).
|
||||
"""
|
||||
pass
|
||||
|
||||
def reflection(self):
|
||||
"""Measure the reflection of a surface using a red light.
|
||||
|
||||
Returns:
|
||||
:ref:`percentage`: Reflection, ranging from 0 (no reflection) to
|
||||
100 (high reflection).
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user