.. _object_LED: :index:`LED` ------------ Description *********** The LED object represents an LED attached to the device. It allows turning on/off or toggling an LED. This object was introduced in InCore 2.0. :**› Inherits**: :ref:`Object ` Overview ******** Properties ++++++++++ .. hlist:: :columns: 2 * :ref:`brightness ` * :ref:`index ` * :ref:`networkInterfaceName ` * :ref:`serialPortName ` * :ref:`systemName ` * :ref:`trigger ` * :ref:`value ` * :ref:`Object.objectId ` * :ref:`Object.parent ` Methods +++++++ .. hlist:: :columns: 1 * :ref:`shot() ` * :ref:`toggle() ` * :ref:`Object.deserializeProperties() ` * :ref:`Object.fromJson() ` * :ref:`Object.serializeProperties() ` * :ref:`Object.toJson() ` Signals +++++++ .. hlist:: :columns: 1 * :ref:`Object.completed() ` Enumerations ++++++++++++ .. hlist:: :columns: 1 * :ref:`Index ` * :ref:`Trigger ` Properties ********** .. _property_LED_brightness: .. _signal_LED_brightnessChanged: .. index:: single: brightness brightness ++++++++++ This property holds the brightness between 0 and 100% which to use when :ref:`value ` is ``true`` and the corresponding LED is controlled through a PWM. This property was introduced in InCore 2.6. :**› Type**: SignedInteger :**› Default**: ``100`` :**› Signal**: brightnessChanged() :**› Attributes**: Writable .. _property_LED_index: .. _signal_LED_indexChanged: .. index:: single: index index +++++ This property holds the index of the LED which to control through the object instance. If :ref:`systemName ` is set, this property is ignored. :**› Type**: :ref:`Index ` :**› Default**: :ref:`LED.None ` :**› Signal**: indexChanged() :**› Attributes**: Writable .. _property_LED_networkInterfaceName: .. _signal_LED_networkInterfaceNameChanged: .. index:: single: networkInterfaceName networkInterfaceName ++++++++++++++++++++ This property holds the name of the network interface (i.e. :ref:`NetworkInterface.hardwareName `) which to indicate traffic for. This property was introduced in InCore 2.5. :**› Type**: String :**› Signal**: networkInterfaceNameChanged() :**› Attributes**: Writable .. _property_LED_serialPortName: .. _signal_LED_serialPortNameChanged: .. index:: single: serialPortName serialPortName ++++++++++++++ This property holds the name of the serial port (e.g. ``ttyUSB0``) which to indicate RX/TX activity for. This property was introduced in InCore 2.5. :**› Type**: String :**› Signal**: serialPortNameChanged() :**› Attributes**: Writable .. _property_LED_systemName: .. _signal_LED_systemNameChanged: .. index:: single: systemName systemName ++++++++++ This property holds the system name of the LED (i.e. the name of the corresponding entry in ``/sys/class/leds/``) which to control through the object instance. This property takes precedence over :ref:`index `. This property was introduced in InCore 2.5. :**› Type**: String :**› Signal**: systemNameChanged() :**› Attributes**: Writable .. _property_LED_trigger: .. _signal_LED_triggerChanged: .. index:: single: trigger trigger +++++++ This property holds a trigger which controls the LED at the system level automatically. See the :ref:`LED.Trigger ` enumeration for details. This property was introduced in InCore 2.5. :**› Type**: :ref:`Trigger ` :**› Default**: :ref:`LED.NoTrigger ` :**› Signal**: triggerChanged() :**› Attributes**: Writable .. _property_LED_value: .. _signal_LED_valueChanged: .. index:: single: value value +++++ This property holds the desired state of the LED. :**› Type**: Boolean :**› Default**: ``false`` :**› Signal**: valueChanged() :**› Attributes**: Writable Methods ******* .. _method_LED_shot: .. index:: single: shot shot() ++++++ This method triggers the oneshot trigger, i.e. initiates a blinking cycle. .. _method_LED_toggle: .. index:: single: toggle toggle() ++++++++ This method toggles the current state of the LED, i.e. inverts the :ref:`value ` property. Enumerations ************ .. _enum_LED_Index: .. index:: single: Index Index +++++ This enumeration describes the supported LED indexes. .. index:: single: LED.None .. index:: single: LED.ActivityRed .. index:: single: LED.ActivityGreen .. index:: single: LED.StatusRed .. index:: single: LED.StatusGreen .. index:: single: LED.StatusBlue .. list-table:: :widths: auto :header-rows: 1 * - Name - Value - Description .. _enumitem_LED_None: * - ``LED.None`` - ``0`` - No valid LED configured. .. _enumitem_LED_ActivityRed: * - ``LED.ActivityRed`` - ``1`` - The red activity LED. .. _enumitem_LED_ActivityGreen: * - ``LED.ActivityGreen`` - ``2`` - The green activity LED. .. _enumitem_LED_StatusRed: * - ``LED.StatusRed`` - ``3`` - The red status LED. .. _enumitem_LED_StatusGreen: * - ``LED.StatusGreen`` - ``4`` - The green status LED. .. _enumitem_LED_StatusBlue: * - ``LED.StatusBlue`` - ``5`` - The blue status LED. .. _enum_LED_Trigger: .. index:: single: Trigger Trigger +++++++ This enumeration describes the supported triggers for controlling LEDs at the system level. A trigger makes the configured LED flash on certain events or under certain conditions. This enumeration was introduced in InCore 2.5. .. index:: single: LED.NoTrigger .. index:: single: LED.Heartbeat .. index:: single: LED.StorageAccess .. index:: single: LED.NetworkTraffic .. index:: single: LED.OneShot .. index:: single: LED.SerialPort .. list-table:: :widths: auto :header-rows: 1 * - Name - Value - Description .. _enumitem_LED_NoTrigger: * - ``LED.NoTrigger`` - ``0`` - No trigger configured. .. _enumitem_LED_Heartbeat: * - ``LED.Heartbeat`` - ``1`` - A trigger indicating a running system as well as the system load. .. _enumitem_LED_StorageAccess: * - ``LED.StorageAccess`` - ``2`` - A trigger indicating access to the local storage (MMC/NAND). .. _enumitem_LED_NetworkTraffic: * - ``LED.NetworkTraffic`` - ``3`` - A trigger indicating traffic at a certain network interface (:ref:`networkInterfaceName `). .. _enumitem_LED_OneShot: * - ``LED.OneShot`` - ``4`` - A trigger for blinking on single events. .. _enumitem_LED_SerialPort: * - ``LED.SerialPort`` - ``5`` - A trigger for blinking on on serial port activity. .. _example_LED: Example ******* .. code-block:: qml import InCore.Foundation 2.5 import InCore.IO 2.5 Application { LED { id: blueLed index: LED.StatusBlue } // toggle blue LED every 1000 ms Timer { onTriggered: blueLed.toggle() } AnalogInput { id: ain index: AnalogInput.AIN1 mode: AnalogInput.Mode10V Polling on value { } } // turn on red LED if AIN1 exceeds 5 V LED { index: LED.StatusRed value: ain.value > 2048 } }