Hw led add

From Sim Innovations Wiki
Jump to navigation Jump to search

Description

hw_led_id = hw_led_add(hw_id, initial_brightness)

hw_led_add is used to add a LED output to your instrument.

Return value

Argument Type Description
hw_led_id ID This value can be used for further reference. Functions such as hw_led_set can use this hw_led_id. Its good practice to store this hw_output_id in your logic code.

Arguments

# Argument Type Description
1 hw_id String The is the reference to the LED output. You can choose to bind to an existing Hardware ID (Hardware_id_list).
2 initial_brightness Number The initial state of the LED. Ranges from 1.0 (full brightness) to 0.0 (off).

Example

-- Bind to Raspberry Pi 2, Header P1, Pin 38, and turn the LED to full brightness
led_id = hw_led_add("RPI_V2_P1_38", 1.0)

-- Nah, rather have the LED set to 50% brightness
hw_led_set(led_id, 0.5)