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 — — —

ARDUINO:
– 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.
ArduinoBTLEDSimple_011_breadboard_bbArduinoBTLEDSimple_007_schematic_schem

ANDROID APP:
– 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.

CHROME EXTENSION:
– 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!



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

 

  43 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(ledMode);
    Serial.print(” running …”);
    Serial.println();

    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…-> https://github.com/neophob/StripInvaders)

    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..)
    http://www.directupload.net/file/d/3498/4hs4gloi_png.htm

    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?

    regards,ozett

    • 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 (https://github.com/neophob/StripInvaders/blob/master/StripInvaders.ino)? 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…

    http://stackoverflow.com/questions/5697047/convert-serial-read-into-a-useable-string-using-arduino

    greets,ozett

  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.

  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.
    thanks

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

  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
    sairamabhishek999@gmail.com

Leave a Reply