Skip to content

Question / Bug: ADC Battery Read (GPIO1) conflicts with E-Ink Display SPI Refresh (GPIO45) #27

Description

@LucaDevCoder

Hi! First of all, thank you for this amazing library. It is a fantastic resource for the Heltec Wireless Paper.

I am developing a custom E-Book Reader application from scratch using your library. Everything works beautifully (text rendering, page changing, and file system), but I am having a problem when I try to read the battery level.

The Problem:

To read the battery voltage, the hardware requires turning on the power gate via GPIO45, which can be done using Platform::VExtOn().

However, if I call Platform::VExtOn() inside my code right before or during the screen refresh cycle, the ESP32 completely freezes and the button stops responding.

On the other hand, if I don't use Platform::VExtOn() and just use a simple analogRead(1), the value returns empty/floating (around 85-87) because the power gate to the battery sensor is closed.

My Question:

What is the correct way to read the battery voltage using your library without causing a conflict with the E-Ink display? Is there a specific place or order in the code where I should perform this reading to avoid the system freeze?

Thank you so much for your time and help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions