History | View | Annotate | Download (1.54 KB)
Added shutoff when current is sensed when enabling tool
Also made a number of fixes to current sensing, which was quite broken.
Fixed another overflow bug and removed isqrt
Fixed timing in current sensing
The ADC interrupt didn't clear the TIFR timer interrupt flag, whichmeans the ADC wasn't triggered again on the next compare match.
Fixed overflow in current calculation
Switch ADC to timer 1 because timer 0 was taken. Oops.
Untested current RMS calculation
It's not actually RMS, it's variance. Same general idea.
Added current sensing to toolbox