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
1 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,8 @@
function init(nstrip, nmod)
print("Initializing with "..nstrip.." strips with "..nmod.." modules each.")
print("Sampling rate: "..CONFIG['sampling_rate'].." Hz")
local nled = nstrip * nmod
red = {}
@ -20,6 +22,10 @@ function init(nstrip, nmod)
end
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
end