From 001af5f0f3fa75b6125718702c490b70a32a074a Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Sun, 21 Feb 2021 19:44:21 +0100 Subject: [PATCH] Added test Lua script demonstrating current features --- test.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test.lua b/test.lua index c486336..1de3880 100644 --- a/test.lua +++ b/test.lua @@ -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