smit-happens / YCP_EVOS

Development for the 2018 YCP Formula Electric Vehicle
MIT License
9 stars 1 forks source link

Battery % Bar goes past the end of the screen and wraps around #169

Closed YoungMaker closed 6 years ago

YoungMaker commented 6 years ago

End goal

Battery bar does not go past the end of the bar 'frame'

Your Code


int hvBarLength = ((BAR_LENGTH-2)*hvBattPercent) / 100;```
this calculation makes an assumption that hvBattPercent is in the range 0,100
smit-happens commented 6 years ago

fixed in e1bc0b6