Code Monkey home page Code Monkey logo

Comments (9)

AronHetLam avatar AronHetLam commented on July 17, 2024

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.

https://github.com/AronHetLam/ATEM_tally_light_with_ESP8266/blob/master/ATEM_tally_light%2FATEM_tally_light.cpp#L987-L1019

from atem_tally_light_with_esp8266.

deluc avatar deluc commented on July 17, 2024

Looks great, thank you, I will try it :)

from atem_tally_light_with_esp8266.

AronHetLam avatar AronHetLam commented on July 17, 2024

Sounds good 👍
Then I'll close this for now.

from atem_tally_light_with_esp8266.

deluc avatar deluc commented on July 17, 2024

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

from atem_tally_light_with_esp8266.

AronHetLam avatar AronHetLam commented on July 17, 2024

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 🙂

from atem_tally_light_with_esp8266.

deluc avatar deluc commented on July 17, 2024

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 :)

from atem_tally_light_with_esp8266.

AronHetLam avatar AronHetLam commented on July 17, 2024

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.

from atem_tally_light_with_esp8266.

AronHetLam avatar AronHetLam commented on July 17, 2024

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.

from atem_tally_light_with_esp8266.

deluc avatar deluc commented on July 17, 2024

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.

from atem_tally_light_with_esp8266.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.