WS2812 control plugin for tSIP
tSIP plugin controlling WS2812 LED strip using UART.
See WS2812 test application for a description of required hardware.
Installation
- copy WS2812.dll from Release_Build folder to tSIP /phone subdirectory
- start tSIP, go to Settings/Phones (plugins) and double click WS2812.dll on the list
- close tSIP - WS2812.cfg would be created in /phone subdirectory next to WS2812.dll
- edit WS2812.cfg with text editor or JSON editor (as this is short file any text editor would be sufficient, I still might recommend JSONedit),
changing COM port name to correct one
- start tSIP and check log if plugin connected
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
- 2024.10.14. Initial release: tSIP-plugin-WS2812-1.0.zip.
Back to tSIP softphone