Closed deluc closed 4 months ago
You're in luck
Earlier someone else added that, so there is some code for it at the bottom of the main program file. I haven't used it myself, but I think it should work if you uncomment it. There are a few other places with battery related code that's commented out.
Looks great, thank you, I will try it :)
Sounds good 👍 Then I'll close this for now.
So I uncommented every bit that (I think) was part of the battery related code, but if I upload it to the esp my led is not blinking after the voltage drops below 3,6V. Sadly I'm not that good with code to trouble shoot it. Do you have any idea what could be the problem? Here is the uncommented code: ATEM_tally_light.cpp ATEM_tally_light.hpp
Are you using regular Leads only, or an LED strip such as neopixels through data pin 7? Looks like the battery code sets the status LED, which would be an LED on a LED strip.
If you need it to blink the regular LEDs, you could make the battery loop set a global variable for when it should be on, and when it should be off. Then use that variable in the setLED function to turn off the LED when needed. It could also be in setLED1 or setLED2 if you only want one of them to blink.
I hope that makes sense 🙂
I'm just using a single LED on Port D0, D1, D2. Sadly it doesn't make sense to me, because my coding skills are like 1/100 :D. So I guess I will not be using this feature. Would be great if you could implement it some time and to enable it via GUI. Seeing the voltage of all connected Tallys on the GUI of my master Tally would also be great. But thank you for ur help :)
I took another look. Try this https://pastecode.io/s/jzxcispd
I added the following to the setLED
method
If (lowLedOn) {
color = LED_YELLOW;
}
It should blink the leds yellow when low battery, temporarily overwriting tally light color.
Also, you might want to move the call to batteryLoop()
down to the end of the loop
function. Currently the battery code is only run while connected to a switcher. By moving it down right below
//Handle web interface
server.handleClient();
The battery code will always run.
Thanks so much! I moved the code exactly as you said (line 438 to line 469). It looks like this:
//Handle web interface
server.handleClient();
batteryLoop();
But then the LED turns red all the time.
Hey, I added the battery shield to the tally light so I don't have to use a cable to power them. The power shield provides the battery voltage to the a0 pin on the d1mini. Would it be possible to add a function to make the led blink if the voltage drops below 3.7 volts? So I will know if the power on the tally is low. Thanks!