You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an error is thrown during the try block, the particular error will get squashed by an `UnboundLocalError: local variable referenced before assignment` exception because `address` is assigned within the try block and consequently isn't defined when we try to log its value under except.
This change resolves the problem by assigning the value before the block. I didn't see the value change anywhere, so I pulled it out as a "constant" `I2C_ADDRESS = 0x1A` at the top of the module and replaced all references to `address`.
0 commit comments