integer math when calculating battery percent
integer math for delay