-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Description
This mainly comes up in conditionals, and can currently be done like this:
if lis3dh.acceleration[2] > SOME_VALUE:
print("Z axis exceeds the value!")
but requires knowing the index of the axis. Is there anyway this could be done where it's more obvious what's being accessed?
Like this:
if lis3dh.acceleration['Z'] > SOME_VALUE:
print("Z axis exceeds the value!")
or this:
if lis3dh.acceleration.Z > SOME_VALUE:
print("Z axis exceeds the value!")
Metadata
Metadata
Assignees
Labels
No labels