Skip to content
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

Add simulator #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add simulator #5

wants to merge 1 commit into from

Conversation

DutChen18
Copy link
Contributor

I've already seen 2 pull request for "animation viewer" or "preview" features to make it easier to write animations.
Having looked at both in my opinion they're not very good, both are very slow to update and either require running in a web browser or significant modifications to the original code.

This pull request implements a better solution, it:

  • is self contained in a seperate file of only 25 lines
  • performs better than other implementations
  • is a drop in replacement for hardware neopixel, only requiring you to change 2 imports
  • does not modify the original code at all

To use it you just need to change 2 lines of code:

    # use real leds
    import board
    import neopixel
    
    # use simulator
    from sim import board
    from sim import neopixel

@Diggsey
Copy link
Contributor

Diggsey commented Dec 24, 2020

This seems to be the best simulator so far 👍

@oliverdunk
Copy link
Member

Hi @DutChen18, thanks for opening this PR! Matt asked me to help with maintaining this repository, and I think having a simulator available would be nice. I love some of the others which all look really polished - but this one stood out for its simplicity.

A few thoughts:

  • It would be great if the simulator could be run without changing the code. Would it be possible to add a command line argument? We could then conditionally import the simulator similar to Add yet another simulator #8.
  • It would be great if the simulator ran automatically for anyone without neopixel, which I assume will be the vast majority of people.
  • Just a little nit but there's a newline missing at the bottom!

Would you be willing to make a few changes based on those? Alternatively, with your permission, I'd be happy to jump in and add a few extra commits. I appreciate that you may not have more time to spend on this.

This was referenced Jan 17, 2021
gentlegiantJGC added a commit to gentlegiantJGC/xmastree2020 that referenced this pull request Dec 24, 2021
Based upon the code from standupmaths#5
With a number of improvements including:
1) Thread support so the UI does not get blocked
2) Made the coordinates configurable as an input
3) Made the axis proportional in size
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.

3 participants