Center of pulsetunnel is now between 2 modules

The LED strip has an even number of modules, so this change makes the
animation completely symmetrical.
This commit is contained in:
Thomas Kolb 2012-07-29 23:46:03 +02:00
parent bac8df287c
commit 6a127ea497

View file

@ -27,7 +27,7 @@ function periodic()
local redEnergy = get_energy_in_band(0, 400); local redEnergy = get_energy_in_band(0, 400);
local greenEnergy = get_energy_in_band(400, 4000); local greenEnergy = get_energy_in_band(400, 4000);
local blueEnergy = get_energy_in_band(4000, 22000); local blueEnergy = get_energy_in_band(4000, 22000);
local centerIndex = 2 * center_module; local centerIndex = 2 * center_module + 1;
maxRedEnergy = maxRedEnergy * COOLDOWN_FACTOR maxRedEnergy = maxRedEnergy * COOLDOWN_FACTOR
if redEnergy > maxRedEnergy then if redEnergy > maxRedEnergy then