Skip to content

Access to single axis value #12

@caternuson

Description

@caternuson

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions