Skip to content

Commit

Permalink
fix out of index bug that occurs during very first startup
Browse files Browse the repository at this point in the history
  • Loading branch information
alustig3 committed May 10, 2024
1 parent 1515805 commit 4cf035b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions software/unitron.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ def __init__(self, unitron, start_opposite):
self.btm = "0"

self.ingredient_index = microcontroller.nvm[0] # recall the last used ingredient from non-volatile memory
try:
self.ingredient = ingredients[self.ingredient_index]
except IndexError:
self.ingredient_index = 0
self.ingredient = ingredients[self.ingredient_index]

self.top_index = 0
Expand Down

0 comments on commit 4cf035b

Please sign in to comment.