Battery low-power alarm
by DragonflyGamerUK
Switches on an alarm, horn, or light when your station battery drops below 25% charge, so you get a warning before the lights go out. Adjust the threshold to taste.
Setup required
Station Battery on d0, Alarm / Horn / Light on d1. Threshold is a 0-1 ratio (0.25 = 25%).
IC10 · 11 lines
# Battery low-power alarm
alias Battery d0
alias Alarm d1
define Threshold 0.25 # 25% state of charge
main:
yield
l r0 Battery Ratio # 0..1 charge level
slt r1 r0 Threshold # r1 = 1 when below threshold
s Alarm On r1
j main