Child pages
  • led
Skip to end of metadata
Go to start of metadata

The led module can be used to change the brightness off the on-board LEDs.

There are 4 LEDs which can be controlled. The LEDs are driven by a PWM signal allowing to change the brightness.

Fields

FieldTypeDescriptionRead/Write
backlightNumberThe backlight of the LCD.Write Only
redNumberThe red component of the RGB LED.Write Only
greenNumberThe green component of the RGB LED.Write Only
blueNumberThe blue component of the RGB LED.Write Only

Valid values for the 4 different LEDs are between 0 (off) and 255 (full brightness).

Backlight LED
-- Set the backlight to 50% duty cycle.
led.backlight = 128

 

In the field approach each color of a led will be used as an individual led.
In practice an RGB led is one physical led which consists of 3 leds which emit one color.

With the functions below it is possible to set a physical led, with a certain color.

Functions

Function

Description

led.blink( id, onColor, offColor, onTime, offTime, times )Makes a physical led with id blink.


led.blink( id, onColor, offColor, onTime, offTime, times )

FieldTypeDescription
idNumberID of physical LED.
onColorNumberRGB value of ontime during blinking.
offColorNumberRGB value of offtime during blinking.
onTimeNumber

Time in milliseconds the led is on during blinking.

offTimeNumber

Time in milliseconds the led is off during blinking.

timesNumberHow may times the led will blink. (will blink until infinity when nil )
led.blink( id, onColor, offColor, onTime, offTime, times )
led.blink( 0, 0x000000FF, 0x00000000, 1000, 1000, 5 )

 

 

  • No labels