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

Serial Control example speed commands reversed #213

Open
furstyferret-dev opened this issue Feb 21, 2020 · 1 comment
Open

Serial Control example speed commands reversed #213

furstyferret-dev opened this issue Feb 21, 2020 · 1 comment

Comments

@furstyferret-dev
Copy link

The speed commands (s+ and s-) are reversed in this example. Just needs the 1.2 and 0.8 multipliers swapping around. Thanks for a great library.

@moose4lord
Copy link
Collaborator

You've touched on a confusing aspect of the library. The speed code was refactored a while back to change the "speed" parameter's behavior to be more of a delay-between-animation-frames. Setting speed=100 means that there will be a 100ms delay between each animation frame. This code refactoring helped solve the thorny problem of synchronizing animations across segments, but it also meant that, counterintuitively, increasing the "speed" parameter causes the animation speed to DECREASE. People assume increasing the speed parameter will increase the animation speed, but it's just the opposite. Maybe when we refactored the code we should have relabeled the speed parameter to something more intuitive, but that would have broken a lot of sketches, so it's still called "speed".

So using s+ in the serial_control example sketch does indeed arithmetically increase the speed parameter (decreasing the animation speed). If you read the book The Dark Forest by Lui Cixin, there's a procedure called a "mental seal", which basically makes someone believe a premise, no matter how irrational the premise may be. My "mental seal" is that the sketch is working as intended. :)

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