Skip to content

Commit c6c4533

Browse files
committed
firmware: Fix off-by-one error in select_from_list_using_cv
1 parent bf7aa13 commit c6c4533

File tree

1 file changed

+1
-1
lines changed
  • firmware/winterbloom_bhb

1 file changed

+1
-1
lines changed

firmware/winterbloom_bhb/bhb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def select_from_list_using_cv(self, list, cv, low=None, high=None):
161161
high = self.max_cv
162162

163163
cv = min(high, max(low, cv))
164-
count = len(list)
164+
count = len(list) - 1
165165
span = high - low
166166
value = cv - low
167167
index = int((value / span) * count)

0 commit comments

Comments
 (0)