Skip to content

order of operators #2

@ady-v

Description

@ady-v

byte_l[6] = ((dt.tm_year-2000 // 10) << 4) | (dt.tm_year-2000) % 10

Thank you for sharing this useful piece of code.
I had a problem with writing/reading the year.
Please consider that the division will take place before the substraction and you need some paranthesis on row 96 of ds1302.py:
byte_l[6] = (((dt.tm_year-2000) // 10) << 4) | (dt.tm_year-2000) % 10

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