Skip to content

Instantly share code, notes, and snippets.

@bettse
Created June 7, 2023 04:23
Show Gist options
  • Save bettse/088f1bb62a8dfc3ffc63d1e5d895d80b to your computer and use it in GitHub Desktop.
Save bettse/088f1bb62a8dfc3ffc63d1e5d895d80b to your computer and use it in GitHub Desktop.

Control LEDs with Mifare Classic

Set the contents of block 1 to control WS2812FX. Will revert to default after 5 minutes.

Format:

Prefix the block with WS2812FX and then provide preferred options: 57 53 32 38 31 32 46 58 MM CC CC CC CC SS SS RR

Mode (1 byte)

  1. Static - No blinking. Just plain old static light.
  2. Blink - Normal blinking. 50% on/off time.
  3. Breath - Does the "standby-breathing" of well known i-Devices. Fixed Speed.
  4. Color Wipe - Lights all LEDs after each other up. Then turns them in that order off. Repeat.
  5. Color Wipe Inverse - Same as Color Wipe, except swaps on/off colors.
  6. Color Wipe Reverse - Lights all LEDs after each other up. Then turns them in reverse order off. Repeat.
  7. Color Wipe Reverse Inverse - Same as Color Wipe Reverse, except swaps on/off colors.
  8. Color Wipe Random - Turns all LEDs after each other to a random color. Then starts over with another color.
  9. Random Color - Lights all LEDs in one random color up. Then switches them to the next random color.
  10. Single Dynamic - Lights every LED in a random color. Changes one random LED after the other to a random color.
  11. Multi Dynamic - Lights every LED in a random color. Changes all LED at the same time to new random colors.
  12. Rainbow - Cycles all LEDs at once through a rainbow.
  13. Rainbow Cycle - Cycles a rainbow over the entire string of LEDs.
  14. Scan - Runs a single pixel back and forth.
  15. Dual Scan - Runs two pixel back and forth in opposite directions.
  16. Fade - Fades the LEDs on and (almost) off again.
  17. Theater Chase - Theatre-style crawling lights. Inspired by the Adafruit examples.
  18. Theater Chase Rainbow - Theatre-style crawling lights with rainbow effect. Inspired by the Adafruit examples.
  19. Running Lights - Running lights effect with smooth sine transition.
  20. Twinkle - Blink several LEDs on, reset, repeat.
  21. Twinkle Random - Blink several LEDs in random colors on, reset, repeat.
  22. Twinkle Fade - Blink several LEDs on, fading out.
  23. Twinkle Fade Random - Blink several LEDs in random colors on, fading out.
  24. Sparkle - Blinks one LED at a time.
  25. Flash Sparkle - Lights all LEDs in the selected color. Flashes single white pixels randomly.
  26. Hyper Sparkle - Like flash sparkle. With more flash.
  27. Strobe - Classic Strobe effect.
  28. Strobe Rainbow - Classic Strobe effect. Cycling through the rainbow.
  29. Multi Strobe - Strobe effect with different strobe count and pause, controlled by speed setting.
  30. Blink Rainbow - Classic Blink effect. Cycling through the rainbow.
  31. Chase White - Color running on white.
  32. Chase Color - White running on color.
  33. Chase Random - White running followed by random color.
  34. Chase Rainbow - White running on rainbow.
  35. Chase Flash - White flashes running on color.
  36. Chase Flash Random - White flashes running, followed by random color.
  37. Chase Rainbow White - Rainbow running on white.
  38. Chase Blackout - Black running on color.
  39. Chase Blackout Rainbow - Black running on rainbow.
  40. Color Sweep Random - Random color introduced alternating from start and end of strip.
  41. Running Color - Alternating color/white pixels running.
  42. Running Red Blue - Alternating red/blue pixels running.
  43. Running Random - Random colored pixels running.
  44. Larson Scanner - K.I.T.T.
  45. Comet - Firing comets from one end.
  46. Fireworks - Firework sparks.
  47. Fireworks Random - Random colored firework sparks.
  48. Merry Christmas - Alternating green/red pixels running.
  49. Fire Flicker - Fire flickering effect. Like in harsh wind.
  50. Fire Flicker (soft) - Fire flickering effect. Runs slower/softer.
  51. Fire Flicker (intense) - Fire flickering effect. More range of color.
  52. Circus Combustus - Alternating white/red/black pixels running.
  53. Halloween - Alternating orange/purple pixels running.
  54. Bicolor Chase - Two LEDs running on a background color.
  55. Tricolor Chase - Alternating three color pixels running.
  56. TwinkleFOX - Lights fading in and out randomly.

Example for christmas lights: 57 53 32 38 31 32 46 58 2F

Color (4 bytes)

Requires mode be specified first

4 bytes WWRRGGBB

From the documentation:

#define RED        (uint32_t)0xFF0000
#define GREEN      (uint32_t)0x00FF00
#define BLUE       (uint32_t)0x0000FF
#define WHITE      (uint32_t)0xFFFFFF
#define BLACK      (uint32_t)0x000000
#define YELLOW     (uint32_t)0xFFFF00
#define CYAN       (uint32_t)0x00FFFF
#define MAGENTA    (uint32_t)0xFF00FF
#define PURPLE     (uint32_t)0x400080
#define ORANGE     (uint32_t)0xFF3000
#define PINK       (uint32_t)0xFF1493
#define GRAY       (uint32_t)0x101010
#define ULTRAWHITE (uint32_t)0xFFFFFFFF /* for RGBW LEDs */

Speed (2 bytes)

Requires mode and color be specified first. Two byte unsigned integer.

From the documentation:

10=very fast, 5000=very slow

Reverse (boolean)

Requires mode, color, and speed be specified first

  • 00: forward
  • 01: reverse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment