[sk] NeoPixel Ring - Counterclockwise rotation - Arduino

Sdílet
Vložit
  • čas přidán 27. 01. 2022
  • One of the viewers of my CZcams channel asked me about the video NeoPixel Ring HSV rotation. It's nice that it rotates clockwise, but how to change the source code of a program , to make it rotate counterclockwise. I immediately told him, which lines should change in the source code. And what was the result? Exactly as expected. It did not work.
    So I sat down at the computer and tried to write code that would rotate counterclockwise. Since I also think that I am a world champion in programming, I used the trial-and-error method and tried and tried and tried and still had no result. And so I had no choice but to think seriously about it. Serious thinking is a difficult thing, and for mental well-being and optimal brain adjustment, more conditions need to be met. If you don't meet them, you won't come up with anything. Once you meet them, you're pouring new ideas up your sleeve. I also fulfilled them and suddenly the code was born and we can show it.
    But we won't cover it in detail in this video. For this purpose, I wrote an article where the principle of changing the source code is explained. The purpose of the video is to show that it really rotates to one side or the other. Everything is affected by a small modification of the source code, which turns on rotation in one direction or another. And the rest is just math.
    With the NeoPixel Ring, it is most difficult to imagine where you are on the ring. And when you're animating, you have to imagine where each point should move in the next step. Use the modulo operation to ensure that you are still on the ring. To make it easier, I've added debug output of current values in variables to the source code. Those who are interested can examine those values and try to understand the principle of animation. If you are not interested, you just run the finished program and watch the animation rotate in one direction or the other.
    Original video
    • Arduino NeoPixel Ring ...
    Article and source code
    www.arduinoslovakia.eu/blog/2...
    github.com/RoboUlbricht/ardui...
    github.com/RoboUlbricht/ardui...
    Music by Scott Buckley - www.scottbuckley.com.au
    www.scottbuckley.com.au/libra...
  • Věda a technologie

Komentáře •