Skip to content

Wrong data types #6

@rodzikkonrad

Description

@rodzikkonrad

Hello.

The main issue in your code is that you are using 'byte' to count the pulses.
Why did you assumed that you can store max 255 pulses in one second?
It coulbe be a lot more and because of that the counter is reseting and it's counting from zero again within the same second.
I think the reason why you had to choose different number for the equation that the vendor provides (F=(8xQ-4) it's because of that. Please change that byte to unsigned int and it should work a lot better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions