Skip to content

Conversation

@mungewell
Copy link

I have a project with multiple modules, when 'blink()' was enabled they blinked a slightly different rates... which looked funky.

The register for blinking also includes a 'display_on' bit, so I access that with a vaule of '-1' to turn off the display(s). Set a normal blink rate to turn display(s) back on.

Tested on the 'HT16K33Segment' from Adafruit.

I have a project with multiple modules, when 'blink()' was enabled
they blinked a slightly different rates... which looked funky.

The register for blinking also includes a 'display_on' bit, so I
access that with a vaule of '-1' to turn off the display(s). Set a
normal blink rate to turn display(s) back on.

Tested on the 'HT16K33Segment' from Adafruit.
@mungewell
Copy link
Author

I realized that it would be more useful if repeated writes of '-1' toggled the display off, on, off, on. That way the app wouldn't need to track the state.

I'll revise the patch tonight...

@smittytone
Copy link
Owner

I'm going to hold off on this PR and look at other ways to implement this functionality. I don't think set_blink_rate() should be used as a proxy for turning the display on or off, as that's a side effect not indicated by the function's name. For example, I'd rather add display_on()/display_off functions, which make what they do explicit.

@smittytone
Copy link
Owner

See the develop branch for how it's looking

@mungewell
Copy link
Author

I adapted your test script for multiple displays:
test_multiple_segment14_ecbuying_054.py.txt

And added a blink check with .display_on() , which failed. I think it is confusing function/variable of the same name

MPY: soft reboot
Address 0x70 Display Found.
Address 0x71 Display Found.
Address 0x72 EIO error (Errno 5): Check connections.
Address 0x73 EIO error (Errno 5): Check connections.
Address 0x74 EIO error (Errno 5): Check connections.
Address 0x75 EIO error (Errno 5): Check connections.
Address 0x76 EIO error (Errno 5): Check connections.
Address 0x77 EIO error (Errno 5): Check connections.
Total 2 Displays found
Traceback (most recent call last):
  File "<stdin>", line 108, in <module>
TypeError: 'bool' object isn't callable

PS. True is/was not capitalized in the assert...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants