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

Weird results in interactive mode #5

Open
benevpi opened this issue Jan 27, 2021 · 3 comments
Open

Weird results in interactive mode #5

benevpi opened this issue Jan 27, 2021 · 3 comments

Comments

@benevpi
Copy link
Owner

benevpi commented Jan 27, 2021

Sometimes I'm getting weird results when using the interactive REPL. No idea why. I'm investigating. I've just put this issue here incase anyone else comes across it.

@benevpi
Copy link
Owner Author

benevpi commented Jan 27, 2021

Looks like it's due to MicroPython not keeping up when in interactive mode. Not quite sure why but the following works:

    def show_unroll(self):
        self.sm.put(self.pixels[0],8)
        self.sm.put(self.pixels[1],8)
        self.sm.put(self.pixels[2],8)
        self.sm.put(self.pixels[3],8)
        self.sm.put(self.pixels[4],8)
        self.sm.put(self.pixels[5],8)
        self.sm.put(self.pixels[6],8)
        self.sm.put(self.pixels[7],8)
        self.sm.put(self.pixels[8],8)
        self.sm.put(self.pixels[9],8)

While the following does not

    def show(self):
        for i in range(self.num_leds):
            self.sm.put(self.pixels[i],8)
        time.sleep(self.delay)

Not too sure what the best way of solving this is ATM

@benevpi
Copy link
Owner Author

benevpi commented Jan 27, 2021

Not sure that this will be solvable until DMA is implemented on MicroPython, but ideas welcome!

@rasperen
Copy link

Have you tried putting a delay after the put?
In the working example, there is time between the execution of the puts (the time it takes for the line being sent)
In the failed example, there is no time between the execution of the puts. Only after all the puts have been executed.
I don't have my pico yet, so I cannot try it myself.

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

No branches or pull requests

2 participants