Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Glow Worm Luciferin
Ambient Lighting or Bias Light is a technology that enhances your viewing experience by projecting colored lights onto the wall behind your TV/Monitor, matching the colors on the screen. This creates a more immersive and engaging atmosphere, making your favorite shows, movies, and games feel even more captivating.

**Luciferin** is a generic term for the light-emitting compound found in organisms that generate bioluminescence like Fireflies and Glow Worms.
`Glow Worm Luciferin is a firmware` for ESP8266/ESP32 boards designed for the
[Firefly Luciferin](https://github.com/sblantipodi/firefly_luciferin) software, the combination of these software create the perfect
Expand Down
187 changes: 187 additions & 0 deletions docs/webInterface_1.5.0.slim.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
function poll() {
var poll = (promiseFn, time) => promiseFn().then(sleep(time).then(() => poll(promiseFn, time)))
poll(() => new Promise(() => {
const http = new XMLHttpRequest();
http.open('GET', 'prefs');
http.send();
http.onload = () => {
console.log(http.responseText);
var prefs = JSON.parse(http.responseText);
console.log(prefs);
if (prefs.toggle == '0') {
$('#toggleLED').css('background-color','lightgrey');
$('#toggleLED')[0].textContent = "Turn ON";
$('#toggleLED').removeClass("active");
} else if (prefs.toggle == '1') {
$('#toggleLED').css('background-color','orange');
$('#toggleLED')[0].textContent = "Turn OFF";
$('#toggleLED').addClass("active");
}
if (prefs.effect == "GlowWormWifi") {
$('#effectSelect').val((prefs.ffeffect.length == 0 || prefs.ffeffect == 'null') ? 'Solid' : prefs.ffeffect);
} else {
$('#effectSelect').val((prefs.effect.length == 0 || prefs.effect == 'null') ? 'Solid' : prefs.effect);
}
kelvinPicker.color.set({ kelvin: (prefs.whiteTemp*100) });
if (prefs.whiteTemp == 65) { $("#ut").show(); } else { $("#ut").hide(); }
if (prefs.cp.length > 0) {
colorPicker.color.rgb = { r: prefs.cp.split(',')[0], g: prefs.cp.split(',')[1], b: prefs.cp.split(',')[2] }
}
brightnessSlider.color.rgb = colorPicker.color.rgb;
brightnessSlider.colors[0].value=Math.round((100*prefs.brightness)/255);
$('#gitlink').text("Glow Worm Luciferin (V"+prefs.VERSION+')');
if (prefs.wifi >= 0) {
$('#wifi').text(prefs.wifi + '% ');
$('#wf').show();
$('#et').hide();
} else {
$('#wf').hide();
$('#et').show();
}
$('#fps').text(prefs.framerate + 'FPS');
if (prefs.ldr) {
$('#ldrgrp').show();
$('#ldr').text(Math.round(prefs.ldr) + '%');
} else {
$('#ldrgrp').hide();
}
$("#autosave").prop('checked', prefs.autosave == 1);
}
}), 5000);
}
function callDevice(payload) {
console.log(payload);
const http = new XMLHttpRequest();
http.open('GET', 'set?payload=' + payload);
http.send();
http.onload = () => console.log(http.responseText);
}
function createPayload() {
var toggleLED = $('#toggleLED')[0];
var payload = {
state: toggleLED.classList.contains('active') ? 'ON' : 'OFF',
effect: $('#effectSelect').val(),
color: colorPicker.color.rgb,
whitetemp: Math.round(kelvinPicker.color.kelvin/100),
brightness: Math.round((brightnessSlider.color.value * 255) / 100),
allInstances: 1
}
return payload;
}
var colorPicker = new iro.ColorPicker('#picker', {
width: 320,
color: '#0091ff',
layout: [
{
component: iro.ui.Wheel
}
]
});
var brightnessSlider = new iro.ColorPicker("#brightnessSlider", {
width: 300,
color: colorPicker.color.rgb,
borderWidth: 1,
borderColor: "#fff",
layout: [
{
component: iro.ui.Slider,
options: {
sliderType: 'value'
}
}
]
});
var kelvinPicker = new iro.ColorPicker("#kelvinPicker", {
width: 360,
color: "rgb(255, 0, 0)",
borderWidth: 1,
borderColor: "#fff",
layoutDirection: 'vertical',
layout: [
{
component: iro.ui.Slider,
options: {
sliderType: 'kelvin',
sliderSize: 40,
minTemperature: 2000,
maxTemperature: 11000
}
},
]
});
$('#effectSelect').change(function () {
callDevice(JSON.stringify(createPayload()));
});
$('#whiteTempSelect').change(function () {
callDevice(JSON.stringify(createPayload()));
});
brightnessSlider.on(['input:end'], function(color) {
callDevice(JSON.stringify(createPayload()));
});
kelvinPicker.on(['input:end'], function(color) {
callDevice(JSON.stringify(createPayload()));
});
kelvinPicker.on(['color:change'], function(color) {
if (Math.round(kelvinPicker.color.kelvin/100) == 65) { $("#ut").show(); } else { $("#ut").hide(); }
});
$('#toggleLED').click(function () {
callDevice(JSON.stringify(createPayload()));
var toggleLED = $('#toggleLED')[0];
if (toggleLED.classList.contains('active')) {
$('#toggleLED').css('background-color','orange');
$('#toggleLED')[0].textContent = "Turn OFF";
} else {
$('#toggleLED').css('background-color','lightgrey');
$('#toggleLED')[0].textContent = "Turn ON";
}
});
colorPicker.on(['input:end'], function(color) {
callDevice(JSON.stringify(createPayload()));
});
colorPicker.on(['color:change'], function () {
brightnessSlider.color.rgb = colorPicker.color.rgb;
});
const sleep = (s) => {
return new Promise(resolve => setTimeout(resolve, (s)));
};
sleep(100).then(() => {
$("#subtitle").text("Bias Lighting and Ambient Light firmware designed for Firefly Luciferin")
$("#ut").text("No white balance")
$('#effectSelect').append(new Option("Solid", "Solid"));
$('#effectSelect').append(new Option("Fire", "Fire"));
$('#effectSelect').append(new Option("Twinkle", "Twinkle"));
$('#effectSelect').append(new Option("Bpm", "Bpm"));
$('#effectSelect').append(new Option("Rainbow", "Rainbow"));
$('#effectSelect').append(new Option("Slow rainbow", "Slow rainbow"));
$('#effectSelect').append(new Option("Chase rainbow", "Chase rainbow"));
$('#effectSelect').append(new Option("Solid rainbow", "Solid rainbow"));
$('#effectSelect').append(new Option("Random colors", "Random colors"));
$('#effectSelect').append(new Option("Rainbow colors", "Rainbow colors"));
$('#effectSelect').append(new Option("Meteor", "Meteor"));
$('#effectSelect').append(new Option("Color waterfall", "Color waterfall"));
$('#effectSelect').append(new Option("Random marquee", "Random marquee"));
$('#effectSelect').append(new Option("Rainbow marquee", "Rainbow marquee"));
$('#effectSelect').append(new Option("Pulsing rainbow", "Pulsing rainbow"));
$('#effectSelect').append(new Option("Christmas", "Christmas"));
$('#effectSelect').append(new Option("Bias light", "Bias light"));
$('#effectSelect').append(new Option("Music mode (VU Meter)", "Music mode (VU Meter)"));
$('#effectSelect').append(new Option("Music mode (Stereo VU Meter)", "Music mode (Stereo VU Meter)"));
$('#effectSelect').append(new Option("Music mode (Screen capture)", "Music mode (Screen capture)"));
$('#effectSelect').append(new Option("Music mode (Rainbow music)", "Music mode (Rainbow music)"));
poll();
});
function asCBAction(cbAs) {
var strConfirm = "If auto save is enabled, color and brightness information is stored into memory to retain this settings after reboot.\nIf you change color often, this can stress the small memory on your microcontroller.\nIn that case it is recommended to disable auto save.\nIf you want to save only one color as default, please enable auto save, choose the desired color and then disable auto save.\n\nDo you want to enable auto save now?";
if (($("#autosave").prop('checked') && confirm(strConfirm)) || !($("#autosave").prop('checked'))) {
const http = new XMLHttpRequest();
if (cbAs.checked) {
http.open('GET', 'setAutoSave?autosave=1');
} else {
http.open('GET', 'setAutoSave?autosave=0');
}
http.send();
http.onload = () => console.log(http.responseText);
} else {
$("#autosave").prop('checked', false);
}
}
33 changes: 24 additions & 9 deletions include/EffectsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,39 @@ class EffectsManager {

public:

static void fire(int cooling, int sparking, int speedDelay, int dynamicLedNum);
static void twinkleRandom();

static void twinkleRandom(int count, int speedDelay, boolean onlyOne, int dynamicLedNum);
void theaterChaseRainbow();

void theaterChaseRainbow(int dynamicLedNum);
void mixedRainbow();

void mixedRainbow(int dynamicLedNum);
void bpm();

void bpm(int dynamicLedNum);
void colorWipe(byte red, byte green, byte blue);

void rainbow(int dynamicLedNum);
static RgbColor Wheel(uint8_t WheelPos);

void solidRainbow(int dynamicLedNum);
void solidRainbow();

void colorWipe(int dynamicLedNum, byte red, byte green, byte blue);
static void randomColors();

static RgbColor Wheel(uint8_t WheelPos);
static void rainbowColors();

static void meteor();

static void colorWaterfall();

static void randomMarquee();

static void rainbowMarquee();

static void pulsing_rainbow();

static void christmas();

void fire(int cooling, int sparking, int speedDelay);

void rainbow(boolean slowdown);
};

#endif //GLOW_WORM_LUCIFERIN_EFFECTSMANAGER_H
6 changes: 5 additions & 1 deletion include/Globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ extern byte bStored;
extern byte brightnessStored;
extern boolean autoSave;
enum class Effect {
GlowWormWifi, GlowWorm, solid, fire, twinkle, bpm, rainbow, chase_rainbow, solid_rainbow, mixed_rainbow
GlowWormWifi, GlowWorm, solid, fire, twinkle, bpm, rainbow, chase_rainbow, solid_rainbow, slowRainbow, randomColors,
rainbowColors, meteor, colorWaterfall, randomMarquee, rainbowMarquee, pulsing_rainbow, christmas
};
extern Effect effect;
extern String ffeffect;
// TODO remove
extern String iip;
extern String bbip;
extern float framerate;
extern float framerateSerial;
extern float framerateCounter;
Expand Down
1 change: 1 addition & 0 deletions include/LedManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class LedManager {

static void manageBuiltInLed(uint8_t r, uint8_t g, uint8_t b);

RgbColor getPixelColor(uint16_t index) const;
};

#endif //GLOW_WORM_LUCIFERIN_LEDMANAGER_H
2 changes: 1 addition & 1 deletion include/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
#define VERSION "5.16.7"
#endif
#ifndef BUILD_TIMESTAMP
#define BUILD_TIMESTAMP "2024-09-21 17:00:15.821945"
#define BUILD_TIMESTAMP "2024-12-17 14:38:58.822045"
#endif

Loading
Loading