Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
45 lines (27 loc) · 1.15 KB

File metadata and controls

45 lines (27 loc) · 1.15 KB
Copy raw file
Download raw file
Outline
Edit and raw actions

class LED -- LED object

The LED object controls an individual LED (Light Emitting Diode).

Constructors

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``.

   *Note:* Only LED(3) and LED(4) can have a smoothly varying intensity, and
   they use timer PWM to implement it.  LED(3) uses Timer(2) and LED(4) uses
   Timer(3).  These timers are only configured for PWM if the intensity of the
   relevant LED is set to a value between 1 and 254.  Otherwise the timers are
   free for general purpose use.

.. method:: led.off()

   Turn the LED off.

.. method:: led.on()

   Turn the LED on, to maximum intensity.

.. method:: led.toggle()

   Toggle the LED between on (maximum intensity) and off.  If the LED is at
   non-zero intensity then it is considered "on" and toggle will turn it off.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.