PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

BasicAnimations.ino 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. Writes "Ardunio" with Persistance of Vision (POV) with 16 LEDs (output 0
  3. is on bottom, output 15 is top). The animation below doesn't work with
  4. more than 1 TLC.
  5. I generated the animation with the included java code:
  6. <arduino folder>/hardware/libraries/Tlc5940/examples/BasicAnimations
  7. To use the code, run
  8. java AnimationCreator
  9. in the folder above and it will parse all images in the folder to
  10. .h files. For best results use images that are 16 pixels high.
  11. See the BasicUse example for hardware setup.
  12. Alex Leone <acleone ~AT~ gmail.com>, 2009-02-03 */
  13. #include "Tlc5940.h"
  14. #include "tlc_animations.h"
  15. #include "ani_arduino.h"
  16. void setup()
  17. {
  18. Tlc.init();
  19. }
  20. void loop()
  21. {
  22. // checks to see if the animation is finished playing
  23. if (!tlc_onUpdateFinished) {
  24. delay(100);
  25. /*
  26. void tlc_playAnimation(prog_uint8_t *animation, uint16_t frames,
  27. uint16_t periodsPerFrame);
  28. periods per frame is PWM periods, 1.024ms per frame (0 is valid - this
  29. will play the animation as fast as possible).
  30. Plays an animation in the "background".
  31. Don't call Tlc.update() while this is running.
  32. You can check if this is done with !tlc_onUpdateFinished */
  33. tlc_playAnimation(ani_arduino, ANI_ARDUINO_FRAMES, 3); // Default is 3
  34. // If you don't want to do anything until it's finished, use:
  35. // while (!tlc_onUpdateFinished);
  36. }
  37. }