2014-11-04 13:25:20 -05:00
|
|
|
.. _pyb.LED:
|
|
|
|
|
2014-10-31 18:21:37 -04:00
|
|
|
class LED -- LED object
|
|
|
|
=======================
|
2014-10-30 21:37:19 -04:00
|
|
|
|
|
|
|
The LED object controls an individual LED (Light Emitting Diode).
|
|
|
|
|
|
|
|
|
|
|
|
Constructors
|
|
|
|
------------
|
|
|
|
|
|
|
|
.. class:: pyb.LED(id)
|
|
|
|
|
|
|
|
Create an LED object associated with the given LED:
|
|
|
|
|
|
|
|
- ``id`` is the LED number, 1-4.
|
|
|
|
|
|
|
|
|
|
|
|
Methods
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. method:: led.intensity([value])
|
|
|
|
|
|
|
|
Get or set the LED intensity. Intensity ranges between 0 (off) and 255 (full on).
|
|
|
|
If no argument is given, return the LED intensity.
|
|
|
|
If an argument is given, set the LED intensity and return ``None``.
|
|
|
|
|
|
|
|
.. method:: led.off()
|
|
|
|
|
|
|
|
Turn the LED off.
|
|
|
|
|
|
|
|
.. method:: led.on()
|
|
|
|
|
|
|
|
Turn the LED on.
|
|
|
|
|
|
|
|
.. method:: led.toggle()
|
|
|
|
|
|
|
|
Toggle the LED between on and off.
|