Created
March 8, 2017 20:04
-
-
Save martonmiklos/f4950173cb961f94a4f6838f233ff22b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint8_t batter_check() | |
{ | |
uint16_t cell_2; | |
uint16_t cell_3; | |
uint16_t cell_4; | |
uint8_t cell_count = 0; | |
cell_2 = designvoltage / 2; | |
cell_3 = designvoltage / 3; | |
cell_4 = designvoltage / 4; | |
if ((3000 < designvoltage / 2)&&(designvoltage / 2 < 4000)) | |
{ | |
cell_count = 2; | |
} | |
if ((3000 < designvoltage / 3)&&(designvoltage / 3 < 4000)) | |
{ | |
cell_count = 3; | |
} | |
if ((3000 < designvoltage / 4)&&(designvoltage / 4 < 4000)) | |
{ | |
cell_count = 4; | |
} | |
else | |
{ | |
cell_count = 0; | |
} | |
return cell_count; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment