Hi
Regarding the 1.2M ohm/100k ohm...just a matter of choice..also what lies around in the shack.
I did the following readAnalog and display the value on a lcd.
With USB power ,external 12.7V battery as source to A1 the value is 913.
With external battery 12.7V as source to A1.
Also supply to Vin to on board 5V regulator the value is 929.
((1.1/1023)*913)*13 = 12.76V
((1.1/1023)*929)*13 = 12.98V
#include "SPI.h"
#include "Adafruit_GFX_AS.h"
#include "Adafruit_ILI9341_AS.h"
#define sclk 13 // Don't change
#define mosi 11 // Don't change
#define cs 10
#define dc 9
#define rst 7 //
Adafruit_ILI9341_AS tft = Adafruit_ILI9341_AS(cs, dc, rst); // Invoke custom library
void setup()
{
analogReference(INTERNAL);
tft.init();// Setup the LCD
tft.fillScreen(LBLUE);
tft.setTextColor(GREEN,BLACK);//fore ground,back ground===removes flicker when update
}
void loop()
{
delay(1000);
Analog_1 = analogRead(A1);
tft.drawNumber(Analog_1,0,0,2);
}