Sorry, your equation is correct.
I check with the ADC example in Cubecell library.
When I apply 1V to the ADC pin, the RAW output is 1003.
When I apply 2.1V to the ADC pin, the RAW output is 2109.
It seems it is converted to mV in heltec ADC library.
In HeltecTM CubeCellTM Series Frequently Asked Questions, It noted ADC input voltage can NOT higher than 2.4V. Please check your ADC pin input voltage within range or not.
https://heltec-automation-docs.readthedocs.io/en/latest/cubecell/frequently_asked_questions.html
If your setup is correct,when you connect 2.9V battery and add voltage divider(220k +100k). The voltage on ADC pin should be 2.9*100000/(220000+100000)= 0.90625V, the RAW value should be around 906.
#include “Arduino.h”
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
}
uint16_t voltage;
void loop() {
// put your main code here, to run repeatedly:
//ADC == ADC1
voltage=analogRead(ADC);//return the voltage in mV, max value can be read is 2400mV
Serial.print(millis());
Serial.print(" ");
Serial.println(voltage);
delay(1000);
}