summaryrefslogtreecommitdiffstatshomepage
path: root/docs/library/pyb.LED.rst
blob: 227450f482aba7de1d81cd54d7750df0bb9e1467 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class LED -- LED object
=======================

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.