Skip to content
New issue

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

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

Already on GitHub? # to your account

Bounds handling in rainbow() has unexpected behavior #25

Open
totally-not-frito-lays opened this issue Apr 2, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@totally-not-frito-lays
Copy link
Member

Describe the bug
Something interesting I noted in #24 is that when giving invalid input (ie. negative numbers) such as rainbow(-5) the behavior here is different than from CC-Library-Lantern. In CC-Library-Lantern the behavior was rapidly changing colors. In CC-Lantern (this repo), the behavior runs slowly, starting at orange.

This may be a quirk of our implementation of the wait() wrapper function. I'll open up a ticket for this.

To Reproduce
Steps to reproduce the behavior:

  1. Open up act3-functions.ino in Arduino IDE
  2. Change rainbow(20) -> rainbow(-5)
  3. Compile and run the file
  4. See slow behavior

Expected behavior
The expected behavior for negative values in the wait() call is to call delay() for 0.25 seconds. This means the colors should cycle through the entire spectrum in 0.25 seconds.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS] N/A
  • Browser [e.g. chrome, safari] N/A
  • Version [e.g. 22] N/A

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6] N/A
  • OS: [e.g. iOS8.1] N/A
  • Browser [e.g. stock browser, safari] N/A
  • Version [e.g. 22] N/A

Additional context
The easiest fix is to have bounds handling inside the function itself.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants