Battery Life
I recently acquired a LilyGO T-Deck,
printed a cyberpunk-inspired case for it, and installed a 2000mAh battery
so that I could run uLisp on. It works
well enough, though I much prefer the PicoCalc's formfactor. That
being said, it's nice to have a well-supported known-good platform to
develop against. I also really like the visual doc-browser
somebody on the forum posted.
One thing I thought would be neat would be to measure how long the
battery life is. An extension I've been building in on every platform
is the (now)
function provided in
the examples, and I found a forum post
that includes a function for this. I wrote a quick "burnout" function
(to burn out the battery) that looks like this:
(defun battery-status nil
; the t-deck is the only platform I have battery
; status working on.
(if (eq *platform* :t-deck)
(list
(cons :battery (battery))
(cons :time (now)))
(list (const :time (now)))
(defun burnout nil
"(burnout)
Burn out the battery: loop forever (until you run out of power)
running a benchmark cycle, then writing battery status and
run time."
(loop
(benchmark)
(with-sd-card (str \"bench.txt\" 2)
(print (battery-status) str))))
It returns an assoc list with :time
containing how long the test ran
for and on the T-Deck, :battery
to show the final voltage. I
probably should have made it append to the file, but as it is, I
record only the very last entry. The burnout
function loops, running
a benchmark suite and writing the current battery-status
to the SD
card. Essentially, I want to know the battery life of a fully active
uLisp machine. For the T-Deck, I turned on the keyboard backlight, and
on the PicoCalc, I turned on the backlight to level 2 and added two
levels of brightness to the screen. Not surprisingly, with a pair of
3200 mAh INR18650-33v batteries, the PicoCalc lasted quite a bit
longer.
- T-Deck:
((:battery . 2.92059) (:time 5 33 56))
: roughly 5h35m given the time it took to get the benchmark started. - PicoCalc (overclocked to 200MHz):
(:time (16 0 41))