Skip to content

Commit

Permalink
firmware: Fix off-by-one error in select_from_list_using_cv
Browse files Browse the repository at this point in the history
  • Loading branch information
theacodes committed Aug 13, 2021
1 parent bf7aa13 commit c6c4533
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion firmware/winterbloom_bhb/bhb.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def select_from_list_using_cv(self, list, cv, low=None, high=None):
high = self.max_cv

cv = min(high, max(low, cv))
count = len(list)
count = len(list) - 1
span = high - low
value = cv - low
index = int((value / span) * count)
Expand Down

0 comments on commit c6c4533

Please sign in to comment.