This is my first blog post regarding actual work on the project, as well as some basic info on my Hero board - the RedBear Blend v1. I got most of my stuff from Element14 already, but I still don't have the Blends I ordered - I want 3 of them in total to present my project's outcome well. The first one is already here
Unboxing the RedBear Blend
My Hero is an Arduino Leonardo-compatible board with a castellated NRF Bluetooth module soldered on. There is a chip antenna on the board as well, and a u.FL connector to add an external one if neccessary, which I find very nice. There is also an array of goldpin headers on the board whose main purpose is to enable the user to choose which ATMega pins are used to communicate with the NRF module, but the pins can double as male equivalents of the staple Arduino female headers. I've been looking at BLE-enabled Arduino derivatives for quite some time, thinking of basing some one-off installations on them. I was enthusiasthic about the RedBear Blend, having found it in this Challenge - comes in several form factors, has everything I'd need minus LiPo support - but! It's never that simple, huh.
Only after I have ordered 2 more Blends at Element14, so that I have 3 identical boards to work on for showcasing the Animator with LED strips of different lengths, did I start browsing for documentation. It didn't take much time to find out that the Blend's creator is merging with Particle and that all the boards will be discontinued. Oh well. This means that I'll end up with a bunch of retired Arduino derivatives by the end of this Challenge, but anyway they will still be workable Arduinos. If there is time left before the end of the project I might work towards making my code compatible with a different hardware platform. Not great but life still goes on.
I managed to get the board connected to my PC and used the guide on GitHub to add all neccessary files to my Arduino IDE (you need 1 new board file and 2 libraries, all there in their respective managers). Then I got the Android app called RedBear BLE Controller on my phone and tested the board with examples provided by the manufacturer. All those I tested worked well, though I got a feeling that the BLE Controller app was a bit unwieldy. One of the libraries you need to install for the Blend to work is called "BLE SDK for Arduino" and contains a lot of examples related to some specific applications, using the BLE predefined services. This might be useful for some testing when time comes to connect wirelessly with the BeagleBone, but that's scheduled for the coming weeks. All in all, everything seems to work fine with the board for now, although the future fate of the product line is quite sad.
My hardware
At the moment I needed to simply see if addressable LEDs work fine with the Blend. They provide the core functionality of my project and they'll all be of the WS2812 waterproof strip variety, as I have plenty of those left over from a wearable project I did two years ago. As none of them had their original wiring intact, I soldered a ribbon cable from a broken hobby servo to the connector pads on one of the strips, jumpered that with the Blend, and that's it. When I attach a power supply I will get my hardware actually 100% complete on the electronics side - naturally there will be more to come in terms of nice enclosures and proper wiring, but functionally almost everything is here already.
My software
As the Blend is basically just an ATMega32U, I encountered no difficulties firing up some Arduino examples for the WS2812. One such example is handily bundled with the libraries Blend requires, but I used Adafruit's NeoPixel for early tests, and then switched to FastLED which I discovered while doing research for this project. It has more examples and looks somewhat more advanced than NeoPixel. All good, but I needed nice patterns and effects that I could use for the Animator, and apparently there is no single library of these or any repository that bundles them. Fortunately, I found a nice piece of Arduino code: the FunkBoxing FastSPI Examples script. It's quite overwhelming as it's just a wall of nearly a thousand lines of code, not organised into any structure of files and not very well commented. Also, it's tailored for WS2811 LEDs, which use SPI rather than a custom one-wire protocol, but I was able to easily adapt the code for WS2812 LEDs using tips left in the comments by other users. I am now working on a cleaned-up version of this snippet and will hopefully put it on GitHub in the next few weeks, as it will be my intermediate step between using the script as it is and making it into a pre-production version for my project. A huge advantage of the FunkBoxing code is its wealth of over 30 premade LED patterns which come with a semi-homogenous interface of parameters like speed and max brightness. I really like the patterns, which include Matrix rain and several variations of fading rainbows, and this code will solve a few of my problems after some modifications are made. If nothing goes wrong it will be used as a basis of the Arduino-side code for the Animator. More on that next week.
By the way, the license for the FunkBoxing code reads as follows:
### LICENSE:::USE FOR WHATEVER YOU WANT, WHENEVER YOU WANT, HOWEVER YOU WANT, WHYEVER YOU WANT ### BUT YOU MUST YODEL ONCE FOR FREEDOM AND MAYBE DONATE TO SOMETHING WORTHWHILE
If anybody has any clue what's that thing I must do once for freedom, I'll be happy to know. I tried googling to no avail, maybe I don't get the joke as a non-native speaker of English.
Up next
Coming up are my first steps with Beagle Bone Wireless, making the Blend discoverable over Bluetooth and developing basic connection features on both the Beagle Bone and the Blend. Hopefully I will manage to send some parameters to the board to change the LED pattern as well. I need to go pick up my other Blends as well, so that I can multiply the hardware and start playing with more strips. Plans have been made for the next 10 weeks, not all it takes is sticking to them. So simple! Or not.
Top Comments