Nov 102013

[EDIT] Here is a link to an update of these effects made by Stefan Mayer designed to work with the OctoWS2811 LED Library. Thanks a lot Stefan, great work!

[EDIT] I’m planning to clean up the Android control app source and put it on github, but in the meantime here’s the code.

[EDIT] If you end up using this code for a project please send me a link/pics/video! I love seeing what people do with this! If you like I’ll post a link to your project on the FastSPI FX – User Coolness post. Also make sure to thank Daniel Garcia (the genius dev of the FastSPI library) on the G+ FastSPI Community.

Here is an update to the Arduino FastSPI2 FX demo code (v0.51). I’m also introducing an Android Bluetooth Control App and a Chrome Extension.

I’ll continue to work on improving these programs but I think I have them to a point where it might be useful to some people- so here they are!

Here is the Arduino Sketch (v0.51)

Here is the Android App on the Google Play Store (v0.1a)

Here is the Chrome LED Controller Extension (v0.1)

— — — SETUP / NOTES — — —

– This version uses the Software Serial library and FastSPI2 library. Also the default serial speed is now 57600.
– The following is a breadboard layout and schematic for setting up a JY-MCU Bluetooth chip with an Arduino (Duemilenove or Nano) to drive a strip of addressable LEDs. This should work with any LED strip that is supported by FastSPI2 RC4 and later.

– To control LED strips via the Android app you’ll have to pair the JY-MCU module with your smartphone/tablet in the Bluetooth/Wireless settings. The PIN for these modules is usually 1234.

– To load the extension, unrar the file to a directory. Then in Chrome go to Settings>Extensions>Load Unpacked Extension. Then select the directory. Then you can launch it from there.
– This extension has been tested on Ubuntu 12.04 and WindowsXP. For Windows you’ll have to install the USB Serial drivers, but the automatic driver search seems to work fine for this.

— — —

If you find this really useful, please consider donating a little to the cause. Thanks!
[paypal-donation reference=”FastSPI2 LED FX – Android/Chrome”]

I’m also grateful for bitcoin donations to: 1K5Yy77ejes2FZrHBG5fns3QAicnwZcduq


  55 Responses to “FastSPI2 LED FX v0.51 w/ Android Bluetooth Control App and Chrome Extension”

  1. […] Please check out the newest version of the FX Code (v0.51) with Android Bluetooth Control App and Chrome Control […]

  2. […] check out the newest version of the FX Code (v0.51) with Android Bluetooth Control App and Chrome Control […]

  3. […] check out the newest version of the FX Code (v0.51) with Android Bluetooth Control App and Chrome Control […]

  4. Hey, is it possible to have the Android Project please ? 🙂
    Amazing work though !

    • Hey, I just sent it to you in an email. I need to do some cleanup and maybe put it up on github before I link to it in the post, but if anybody else is jonesin’ for the code send me your email in the contact form and I’ll let you have it in the current ‘quick-n-dirty’ form.

  5. Wonderfull Project!
    i switched over from stripinvades (), because your project has support for my ws2811 stripes (and other in fast_spi2 library).
    i had it runing on leonardo, but needed a “wait serial” in setup. i also had it running on itead`s iboard (which is 3,3V, but is doing well on data-pin with this). BUT: i cannot figure out (or a bug?), how to set single color in serial-console. i can switch the modes now with “m6” or “m999” or to demo with “m888”, but if i am in mode 999, i give on serial-console “i3255255255z” (is that correct?), nothings happens. i would expect to switch on led3 with rgb=255,255,255. Also: i put on serial-console “a100z”, only all leds become white. nothing else. i can clear all with “cz” — but doing it right? Whow to set a single color an the whole stripe?

    my stripe has the wrong color order, so as i proved to be working with pure fast_spi2, i changed the stripe definition to ‘GRB’:
    LEDS.addLeds(leds, LED_COUNT);

    a put a little feedback in console, to see on serialmonitor which mode is on:
    “…//——————MAIN LOOP——————
    void loop() {

    Serial.print(“Mode: “);
    Serial.print(” running …”);

    switch (ledMode) {
    case 999: break;
    case 2: rainbow_fade(); Serial.println(“now mode2: rainbow_fade”); break;
    case 3: rainbow_loop(); break;
    case 4: random_burst(); break;

    i would appreciate a litte help. but go on: wonderful FX, wonderful project !!
    greeting, ozett

    • I should probably document this better, especially since I’ve made some changes over the versions that I haven’t really explained in the posts.

      The single LED mode addressing command should be ‘l’ (lower case L). It looks like you’re using an ‘i’ (lower case I)

      The command ‘a100z’ should set the color to whatever HSV value 100 is, but if the saturation value is low then it will look white.
      Try ‘t255z’ then ‘a100z’ and let me know how that goes.

  6. hi, me again. i investigated a little bit (as i am no programmer) an found modes 101,102,103. But as mode 101=red is ok, 102 should be green, but is blue. Mode 103 should be blue, but is green. That means my stripe is in pure fast_spi2_rc5 GRB, but if i use this definition for the ws2811 in your sketch, green an blue are switched somehow. Red seems to stay first.
    so for that. but now i am littlebit clueless what to do…. a hint from the inventor?….
    regards, ozett

    • I’ve had trouble with the RGB order on some strips myself. I’ve had to resort to trial and error a few times. From what you describe it seems like the order should be RBG, but there is a RGB calibration sketch in the FastSPI2 examples, give that a shot.

  7. hi,
    thanks for your answers. it helps me a lot….wounderful project, once again.

    for the RGB order of my stripes: the rigth line got lost in my first post, for the setup of the stripes i have put:

    LEDS.addLeds (leds, LED_COUNT);

    after i did the RGB-calibration sketch of fast_spi2. i saw that my stripes had to be ordered as GRB, i put that in a fast_spi2 sketch and it worked there now exactly as expected in correct order. but if i used that setup-definiton in your fx-sketch, i have in modes 101,102.103 the ‘wrong’ switching of blue and green (as i tried to descriped in my second post) another idea for a fixing?

    for the single-led adressing: i will give that a try in the next hour and i will post the result. seems promising ….

    (maybe you want to have a look a stripinvaders for web-intergration on adruino? realy a similar nice project (not from me!) stripinvaders has OSC-messages and bonjour…->

    great thanks and regards,ozett

  8. hey, the line vanishes here in the posting again. some problem of the editor with special-chars?
    i removed the greater/less-chars. just to make clear:

    LEDS.addLeds –lt– WS2811, LED_DT, GRB –gt– (leds, LED_COUNT);

  9. hi, i had time to test the single-led adressing. seems a problem with the index?
    i cannot attach images, i uploaded one here. ( i put a debug line in, to see what is the counter of the index-var, and it was negative..)

    i tried ‘t255z’ then ‘a100z’ and let me know how that goes. – and it goes well. somehow the most t-values below 100 look like white-colors, but must be light-white-colors of the HSV-color. to me they are roughly variants of a light-white. but it works.

    maybe you have a clue to fix the single-led adressing?


    • Yeah the saturation value below 100 tends to look white, especially with the brightness set low, which it is by default in the code.

      I think I forgot to mention that in the command for individually addressing LEDs you need to separate the integers with commas. Try “l3,255,255,255z”

      • i used your suggested syntax and: i worked. hurrahhh, thanx.

        another thing is: i wanted to put all on an iboard with wiznet-ethernet, but i grows too big. as i am surely no coder, so i can not really manage to shrink the code, and so i have to ask: do you looked at the code of stripinvaders ( i looks like clean and straight code. as far as i can see the question arises: why dont you implemented the demo as a time-switching of modes in the loop? i could maybe save some codelines seems clearer than an extra demo, or am i wrong with this?

        • Hey- glad you got it working. I’ll look into the StripInvaders code and see if there it anything I can implement. In general though my code isn’t meant to be for ‘out-of-the-box’ use. It’s just a set of demo FX functions to help others get started with their own projects. I figured most people would cut-and-paste the functions they want for their projects. The demo mode especially was sort of an after-thought. I never meant for it to be used for anything other than to display the available functions. It is pretty clunky though 😉

          Thanks for the link though- I’ll check it out and see what I can learn.

          Please post a link to some pics/videos of your project once you get it up and running. I love seeing what people make with these FX!

  10. It would be great app if it could support communication over USB serial on android device :D. Thanks for great work 🙂

  11. my desired arduino is an iboard from itead. it is cheap and has a wiznet51 Ethernet on board. i can power the board an the stripes with 12v, which makes the hardware-setup easy. to have all your fx’s in the sketch, i desperately needed to shrink the size. wiznet also seems a bit larger than the enc28xx ethernet-library. but if i am no programmer, i go on with this very slowly.
    if you ever go to version 0.52 or beyond, i successfully shrinked the size with changing mostly

    var type: int (2bytes/4bytes) to uint8_t (1byte)
    inserted #ifdef demo {democode} #endif around your democode
    inserted #ifdef for all serial.println debug-output
    inserted #ifdef for software.serial and bluetooth (which i dont need at the moment)

    i will go further in the speed of an old turtle to get the size down. at the moment it fits and it is running well.
    (maybe you checked stripinvaders and found /osc interesting? But there is also this atmega limitation of 32k. seems that an uno has a little bit more than an leonardo or a due while compiling in the ide 1.x.

    great code, lots of thanx,ozett

  12. oh, i forgot to mention this interesting code-fragments for serial-input.
    makes it cleaner and straighter, i guess. maybe worth a look…


  13. […] also discovered some really cool code called FastSPI2 LED FX that has a load of pre-defined effects for any LED strips supported by the FastSPI_LED2 library.  […]

  14. Hi so I’m having issues getting the app to communicate correctly. it will connect to the JY-MCU fine but when i try give it commands nothing happens. Except when i hit the SerialTest button, then the entire strip turns off and I have to reset the arduino. Any idea what’s going on?

    • Try setting the SoftwareSerial baudrate to 9600. That’s the default for most JY-MCU modules. I change mine to 56700 with the AT commands but if you haven’t done this then that might create a communications problem. Let me know how it goes.

  15. Hi there.
    Really cool project! I use your code to build a LED Table, everything works fine so far, but if i use more than 160 leds the arduino stops working. I´m using WS2812B and added “LEDS.addLeds(leds, LED_COUNT);” to the code, works fine.
    But like i said, as sonn as the Led Count reaches 160, everything stops working.

    any idea why? any help?

    greetz cRaSh

    • I’ve used this code with 120 LED’s myself so I don’t think there is any limitations built in. It might have something to do with the power supply. Even if you have a PSU with enough current it might not be making it all the way down the strip. Try taking a voltage reading at LED number 80 or so and see if the voltage is close to 5V. If not you could try ‘injecting’ another 5V line somewhere down the strip.

      • Power is no problem, my PSU is big enough.
        If i strip down the code and remove the bluetooth/serial part, everything works fine, all Leds are working.
        I guess it’s a timing issue, my bluetooth only works with 9600baud, will try to change that, but i don’t have the hardware for that.

        thx for the help

        greetz cRaSh

        • I’ve been able to change the baudrate on JY-MCU modules with AT commands pretty easily, what bt module are you using?

          You could also try running half the strip on one pin and half on another. FastSPI supports multiple strips. I have a post on how to set that up.

          You might also post this question on the Google+ FastSPI community. There are lots of users on there with more experience with the WS212B than I have. Good luck!

          • I tried both today.

            Switched the Baudrate to 115200, and configured 2 strips:
            LEDS.addLeds(leds, 98);
            LEDS.addLeds(leds, 98, 98);

            nothing works.

            Thx a lot for your help so far, but i guess i´m stuck right now.

            greetz cRaSh

          • Hi! Do you have a Solution for the Problem? I have exactly the same Problem!

          • Re: the 160 thing – it sounds like you may be running out of memory. What arduino are you using this on? 160 leds are going to use 480 bytes of ram. SoftSerial is going to be using at least another 64 bytes for its serial buffer. I can’t speak to how much ram the bluetooth library may/may not be using.

            Also – if you have any other buffers that are sized based on the value of NUM_LEDS, that’s also going to affect the amount of ram used.

        • Hi guys, I’m running into the same issue with a Arduino Uno and a WS2812b strip. My strip of lights has 240 LEDs but the Uno seems to max out of memory at 170 LEDs (#define LED_COUNT 170).

          Here’s the message I get at 170:

          Sketch uses 20,746 bytes (64%) of program storage space. Maximum is 32,256 bytes.
          Global variables use 2,048 bytes (100%) of dynamic memory, leaving 0 bytes for local variables. Maximum is 2,048 bytes.
          Low memory available, stability problems may occur.

          Is there another way to do this that may cut down on memory consumption? I’ll scour the code but wondering if anyone else has come up with a solution first. Seems like reducing the global variable size would be the first place to start…

          Thanks! This guide has been a TON of help. I’ll post photos of the infinity coffee table when it’s finished! 🙂

  16. Im trying to compile the arduino sketch but I’m getting a error

    “sketch_mar02a:40: error: ‘SoftwareSerial’ does not name a type
    sketch_mar02a.ino: In function ‘void setup()’:
    sketch_mar02a:769: error: ‘btSerial’ was not declared in this scope
    sketch_mar02a.ino: In function ‘void loop()’:
    sketch_mar02a:891: error: ‘btSerial’ was not declared in this scope”

    Thanks in advance!!

  17. I’m newbie to Arduino. I already have nano and led strip. I don’t have bluetooth mordem but I have bluetooth inside my laptop, so can I setup it work with nano board? I have a lot laptop bluetooth. I hope can use it with arduino.

  18. The chrome Extention does not find any com is there an reason ?

  19. Hi,
    I would love to use your script/program. Working on a light installation for a club in Amsterdam, although i am new to Arduino and programming. Currently I tried using this on an Arduino Uno and it did not work. Would you be able to help me, Maybe we can Skype ? I am willing to “donate” you for your time

    • Sure. I’d be happy to help if I can. Contact me via the contact form and tell me more about your project.

      • I have send you an email. The project deadline is close and would love to use your product, please get beck to me asap if you can. Sacha

  20. Hi i want to use your sketch , first of all it works fine . But i´m really new in Arduino , can you tell me how to set up the Micro for use with a BT Modul ? Sometimes ist works , but only one Time and often when i Tturn off all lights . Tested a Lot and cant find my fault . Sorry for my bad English . Cheers , Jean

  21. Does this work with fastled.h?

  22. Hi,
    I just tested this project, but i couldn’t get the same result as the video.
    Im using Arduino Uno and 5050 Led strip type, is it compatible with the coding in this project?
    By the way, are you using 5050 led strip type or else?

  23. Hi,
    i’ve tried this project but i didnt get the exact result as the video.
    Im using Arduino UNO nad 5050 LED strip type.
    It is my equipment suitable for this project?
    By the way, what type of LED strip you used? 5050 or 3528?

  24. Hi!
    I tried to load Your code on my arduino, but I can’t get the code working. If I try to upload the code, Arduino (program) says “elements of array ‘CRGB leds [23]’ have incomplite type”. Can You please help me with this…?

  25. Hello. With 14 LED on Arduino Nano the Demo Mode 888 depends after 6 runs and must be reset. Why ?

  26. Bro can i have source code for the above project? plz inbox the source code to my emailid provided

  27. Hi,
    Loving this even years on from your original build.
    Was curiois on a few thing’s if you or anyone else can help me with Please.
    ok so here goes…

    I am a noob so please go easy on me I have 0 coding knowledge save a few minor project but nothing this involved editing the actual android app

    when building or editing you app i’m using the android studio 2.3
    But i can figure out how i add led effect’s ( more specifically i can’t figure out how to link the name in the drop box to the serial command?)
    i downloaded the update fx but it says i need DMA etc.. i understand this requires a teensy?
    i have mega, uno and 10 nano’s available (current i’m using ws2801) but i have 500 ws2811 leds on the way for a home lighting and a vehicle bling project.

    • 3rd
      I can’t for the life of me figure out how the audio function works? it just doesn’t.
      I would also like to add the actual kit pattern from the front of the car the 1 included is all wrong and i have no real knowledge of how to edit or even make my own… however i can learn fast and if someone is willing to take a bit of time out and talk me through it id very appreciate it.

      current hardware can be any arduino uno, nano or mega, galaxy note 4 or amazon tablet<not yet tested

  28. How do I get sou d response working? I been working with 25 ws2801s and a galaxy note 4 but can’t seem to get sound response out if it?

  29. envia as libraryes + o cod arduino para o aplicativo android e chrome por favor

  30. This Is a great project.
    I couldn’t get it to work because i have ws2812b leds with no clock pin.
    with the help of FastLED v3.1 I got it to work.
    i downloaded and installed it here:
    don’t forget to rename the folder to FastLED in your library

    code changes and additions:



    #include “FastLED.h”


    #if FASTLED_VERSION < 3001000
    #error "Requires FastLED 3.1 or later; check github for latest code."


    #define LED_COUNT 100 //FOR TESTING w/ SIGN
    #define LED_DT 13 //SERIAL DATA PIN
    #define LED_CK 11 //SERIAL CLOCK PIN


    #define LED_COUNT 100 //FOR TESTING w/ SIGN
    #define LED_DT 13 //SERIAL DATA PIN
    #define DATA_PIN 13
    #define LED_TYPE WS2811
    #define COLOR_ORDER GRB
    #define NUM_LEDS 100

    This Worked For Me.
    Thanks for all your hard work so long ago

  31. Great work. Great site. Congratulations. Are there any codes for ws2812?

  32. Hello there. Great work. How can we use ws2812b?

  33. Hey, Great Project. I have a quick question, in the switch (inbyte) menu case 109 changes the mode, if I change 109 to another number nothing works the same with case:98 for brightness. Where are these numbers declared in the sketch, I can not find them anywhere not even in the FastLed Library? Can they be changed? Thanks!!!

  34. […] had a few people contact me and let me know they’ve used the FastSPI library and my demo FX code. They are some really cool projects! I really appreciate it when people show me what they’ve […]

  35. […] Nu am găsit niciodată un depozit unic de modele, totuși FunkBoxing are o schiță fantastică cu 30 sau mai multe modele bine documentate. […]

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>



This site uses Akismet to reduce spam. Learn how your comment data is processed.