use int instead of long to store samples
misc changes to battery module