WS2812 control plugin for tSIP

tSIP plugin controlling WS2812 LED strip using UART.

See WS2812 test application for a description of required hardware.

Installation

Usage

LEDs are controlled from Lua scripts by sending "WRITE" command to plugin with a list of numbers representing red, green and blue brightness (0...255 range) for each LED. Total number of parameters would be equal to number of LEDs multiplied by 3.

Lua scripts controlling LEDs can be used e.g. for "on call state change" and "on BLF state change" events.

Example: controlling single LED

PluginSendMessageText("WS2812.dll", "WRITE 0 0 10")

Example: setting values for 8 LEDs

PluginSendMessageText("WS2812.dll",
	"WRITE 10 0 0   0 10 0   0 0 10   0 0 0   10 10 0   10 0 10   0 10 10   10 10 10")

Example: blinking LED (until Break is pressed in the script window)

while (1) do
	PluginSendMessageText("WS2812.dll", "WRITE 0 0 10")
	Sleep(250)
	PluginSendMessageText("WS2812.dll", "WRITE 0 0 0")
	Sleep(250)
	local ret = CheckBreak()
	-- break on user request
	if ret ~= 0 then
		print ('User break\n')
		break
	end
end

Source and binary

Back to tSIP softphone