Added test Lua script demonstrating current features

This commit is contained in:
Thomas Kolb 2021-02-21 19:44:21 +01:00
parent 8776e8e960
commit 001af5f0f3

View file

@ -1,6 +1,8 @@
function init(nstrip, nmod) function init(nstrip, nmod)
print("Initializing with "..nstrip.." strips with "..nmod.." modules each.") print("Initializing with "..nstrip.." strips with "..nmod.." modules each.")
print("Sampling rate: "..CONFIG['sampling_rate'].." Hz")
local nled = nstrip * nmod local nled = nstrip * nmod
red = {} red = {}
@ -20,6 +22,10 @@ function init(nstrip, nmod)
end end
function periodic() function periodic()
print("Going round and round...") bass = sigproc:get_energy_in_band(0, 400)
mid = sigproc:get_energy_in_band(400, 4000)
treble = sigproc:get_energy_in_band(4000, 20000)
print("Bass: "..bass.." Mid: "..mid.." Treble: "..treble)
return red, green, blue, white return red, green, blue, white
end end