Skip to content

Missing abs() in spinner examples to determine maximum value #46

Closed
@kevinjwalters

Description

@kevinjwalters

Both examples/spinner.py and examples/spinner_advanced.py feature the same code which reads 32 values in total and looks for maximum absolute value from the x-axis accelerometer value. There's a missing abs() on the first read before the loop which looks like a bug?

        maxval = lis3dh.acceleration[0]  # Grab just the X acceleration value.
        for i in range(31):
            x = abs(lis3dh.acceleration[0])
            if x > maxval:
                maxval = x

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