Skip to content

Added 7-Segment FeatherWing #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 14, 2019
Merged

Conversation

makermelissa
Copy link
Collaborator

Now the that last pull request has been moved along, here's the next one. This adds the 7-segment featherwing and gives it similar functionality to the alphanumeric one.

@makermelissa makermelissa requested review from a team and removed request for a team February 12, 2019 18:25
@jerryneedell
Copy link
Contributor

hmmm -- just a heads up -- I tried thsi on a Particle Argon and it causes the board to reset ??
checking to see if I have something configured wrong

@makermelissa
Copy link
Collaborator Author

Uh oh. I don't have any particle boards to test this out on. :-\

@makermelissa
Copy link
Collaborator Author

Could you also check the AlphaNumeric FeatherWing if you have it Jerry? The code bases are pretty much the same.

@jerryneedell
Copy link
Contributor

no idea why it should matter -- do you have any nrf52840 boards?

@makermelissa
Copy link
Collaborator Author

Nope.

@jerryneedell
Copy link
Contributor

works fine on a feather_m4_express.. I'll try a different nrf52840

@jerryneedell
Copy link
Contributor

fails the same way on a feather_nrf52840_express -- very strange

@jerryneedell
Copy link
Contributor

I'll try the 14 segment

@jerryneedell
Copy link
Contributor

same result with alphanum

@makermelissa
Copy link
Collaborator Author

Yeah, I developed it against a Feather M4 Express and I think I tried it out on the Feather M0 as well.

@jerryneedell
Copy link
Contributor

let me try previous release of alphanum

@makermelissa
Copy link
Collaborator Author

Could you see if you could narrow it down to where it's failing?

@jerryneedell
Copy link
Contributor

same with previous release -- I'll dig into it -- to board goes to safe mode! I'll also ping Danh

@makermelissa
Copy link
Collaborator Author

I'm wondering if the issue is in this library or the ht16k33 library.

@jerryneedell
Copy link
Contributor

the ht16k33 works for the 14segment on the feather_nrf52840

@jerryneedell
Copy link
Contributor

opened issue in CP adafruit/circuitpython#1545
it crashes on the featherwing library import if it is in a script ???

@jerryneedell
Copy link
Contributor

as noted in the CP issue -- I can use this library on the feather_nrf52840 if I copy the contents of sevensegment_featherwing.py directly into the main file. here is my test

"""This example changes the fill, brightness, blink rates,
shows number and text printing, displays a counter
and then shows off the new marquee features."""

from time import sleep
import adafruit_ht16k33.segments as segments
from adafruit_featherwing import shared
from adafruit_featherwing.led_segments import Segments

class SevenSegmentFeatherWing(Segments):
    """Class representing an `Adafruit 7-Segment LED HT16K33 FeatherWing
       <https://www.adafruit.com/product/3140>`_.

       Automatically uses the feather's I2C bus."""
    def __init__(self, address=0x70):
        super().__init__()
        self._segments = segments.Seg7x4(shared.I2C_BUS, address)
        self._segments.auto_write = False

display = SevenSegmentFeatherWing()

#Fill and empty all segments
for count in range(0, 3):
    display.fill(True)
    sleep(0.5)
    display.fill(False)
    sleep(0.5)

#Display a number and text
display.print(1234)
sleep(1)
display.print('FEED')

#Change brightness
for brightness in range(0, 16):
    display.brightness = brightness
    sleep(0.1)

#Change blink rate
for blink_rate in range(3, 0, -1):
    display.blink_rate = blink_rate
    sleep(4)
display.blink_rate = 0

#Show a counter using decimals
count = 975.0
while count < 1025:
    count += 1
    display.print(count)
    sleep(0.1)

#Display a Time
hour = 12
for minute in range(15, 26):
    display.print("{}:{}".format(hour, minute))
    sleep(1)

#Show the Marquee
display.marquee('Deadbeef 192.168.100.102... ', 0.2)

this executes on the feather_nrf52840 just fine -- I also ran the alphanum test the same way.

@jerryneedell
Copy link
Contributor

based on the above, I have no concerns with this PR -- it remains to be resolved if the nrf52840 issue is with this library -- already existing or with CP.
Given that, I will approve the PR since it is not relevant to the problem.

Copy link
Contributor

@jerryneedell jerryneedell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found an issue with thsi library overall when used on an nrf52840 but with the workaround described in the comments, I can get everything to wok. It worked fine on the feather_m4_express. I will approve the PR since I don't think it is part of the larger issue.

@makermelissa makermelissa merged commit 57b7e81 into adafruit:master Feb 14, 2019
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Feb 15, 2019
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