# Light : Relay

Implementacja register

Implementuje Light

Włącza lampę podłączoną do przekaźnika modułu Voldeno. Tylko włącz/wyłącz, więc ustaw funkcje bloku światła na Włącz/Wyłącz.

Light : Relay

# Kod źródłowy

Pokaż kod Volang
// Light : Relay - implementation of the light block.
//
// Switches a lamp wired to a relay of a Voldeno module. The relay only knows
// on and off, so brightness and color are ignored, and there is no feedback:
// the light block publishes the state it commanded.

extern fn light_apply(power, brightness, color_mode, color_temp, hue, saturation) {
    if (power) {
        register::set(1)
    } else {
        register::set(0)
    }
    return 0
}
Poznaj działanie bloku logicznego Light : Relay - zasada działania, opcje konfiguracji i przykłady zastosowań w Voldeno.