Skip to content

samples: blinky: add support for non-standard led displays #87613

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AndOrangutan
Copy link

This is a change to enable the blinky sample to work on matrix displays such as the common learner board MicroBit v2.

Copy link

Hello @AndOrangutan, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@AndOrangutan AndOrangutan marked this pull request as draft March 25, 2025 09:16
Extend device tree to work with blinky sample.

Signed-off-by: Von Mueller <[email protected]>
Some boards, such as the MicroBit v2, have no controllable simple
leds. This allows matrix displays to blink a single led.

Signed-off-by: Von Mueller <[email protected]>
@AndOrangutan AndOrangutan marked this pull request as ready for review March 26, 2025 01:55
@sambhurst sambhurst self-requested a review March 26, 2025 17:03
@sambhurst
Copy link
Collaborator

Hello @AndOrangutan, thanks for extending the blinky sample code so that it works on boards without a simple LED connection. Could you updated the README.rst to include the additional LED and how the two LED pins work together to toggle a single matrix LED. And that the additional LED is optional for non-matrix LED displays, but if it's implemented, blinky will simply toggle both LEDs.

@kartben
Copy link
Collaborator

kartben commented Mar 26, 2025

This is complexifying blinky quite a bit for a sample that's meant to be pretty much the next step after "hello world" for most users. I might be missing somethign but it looks like what's needed is rather a new binding/driver that would allow to configure a given LED from an LED matrix as an LED device?

@AndOrangutan
Copy link
Author

AndOrangutan commented Mar 29, 2025

True, @kartben, technically the root problem I wanted to solve was there being no working blinky example for the MicroBit v2 board. I'm not really sure how many other boards even have matrix displays, but I see a couple ways of remedying it:

  1. Creating a board specific example for the MicroBit v2.
  2. Creating a more general binding/driver.
  3. Something like my solution.

With this board being a learner board, it would be useful to have some sort of working blinky. I'm not trying to add unneeded complexity, do you have a preferred solution?

@sambhurst
Copy link
Collaborator

Hello @kartben, could you comment on @AndOrangutan reply?

@kartben
Copy link
Collaborator

kartben commented Apr 24, 2025

True, @kartben, technically the root problem I wanted to solve was there being no working blinky example for the MicroBit v2 board. I'm not really sure how many other boards even have matrix displays, but I see a couple ways of remedying it:

  1. Creating a board specific example for the MicroBit v2.
  2. Creating a more general binding/driver.
  3. Something like my solution.

With this board being a learner board, it would be useful to have some sort of working blinky. I'm not trying to add unneeded complexity, do you have a preferred solution?

Ya I think solution 1 is probably better (although note that there is already a sample for the LED matrix).
Your suggested solution is really making blinky too "bloated" (for the lack of a better word, sorry) to most users. And even the led0 / led1 are confusing are they're not corresponding to actual LED "pins".
solution number 2 might be interesting to explore if we think there is value in proposing a generic binding for describing a group of GPIOs meant to be manipulated as one single "virtual" GPIO, I guess?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants