Thought people might be interested in this. I’ve recently gotten more into my Cardputer at length and have found that I’d like to know how the battery is doing. Per the back of the device, GPIO 10 is connected to a voltage divider which will scale the battery voltage for the 12-bit ADC. Putting that math together (against a max ADC voltage of 3300):
(defun bat nil
(princ
(concatenate
'string
(string
(*
100
(/ (analogread 10) 3300)))
"%"))
nothing)
Output:
> (bat)
98.2%
Relevant part of the schematic: