Hw led set
Jump to navigation Jump to search
hw_led_set is used to set a LED output to a certain brightness.
This function won't return a value.
|1||hw_led_id||String||The is the reference to the LED output. You can get this reference from the hw_led_add function.|
|2||brightness||Number/Bool||The initial state of the LED. Ranges from 1.0 or true (full brightness) to 0.0 or false (off).|
-- Bind to Raspberry Pi 2, Header P1, Pin 38, and drive 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)