Getting Started: Using Sparkles

The Sparkle has got to be one of the most popular and satisfying Crumbs (components) for the Crumble. It is an easy to use RGB LED, which can be set to pretty much any colour. If this wasn’t enough, you can chain up to 32 together, and individually control each one!

They’re really easy to get started with, and are often used as a starting point, due to the clear results and feedback. We’re going to focus on connecting individual Sparkles, however we will look at other Sparkle-based items later on.

To get started, you will need to connect your battery pack to the Crumble. Notice that we connect the positive (+) on the battery pack to the + on the Crumble, and the negative (-) on the battery pack to the – on the Crumble.

Hint: You can connect to either the left or right + and -, but we use the left as standard.

Now we need to connect up our Sparkle. It’s important to get this bit correct, otherwise they won’t work. We need to connect the + and – from the Crumble to the corresponding connections on the Sparkle, and D, which you can think of as ‘data’ connects to the D input on the Sparkle. Take care to notice which way the arrow on the Sparkle points (away from the Crumble).

Now it’s time to get programming! Connect the Crumble to your computer via the micro USB lead, and open up the software. Write the following code, and think about what it will do before you run it. If you need more help programming, check out our first ‘Getting Started’ blog.

When you’re ready, switch on the batteries and run the program. You should see that your Sparkle has now turned red.

Changing the colour of your Sparkle is really simple. Click on the box with the colour in to bring up a colour palette, and select your colour of choice. Reprogram your Crumble and watch the colour change!

More Sparkles

Using multiple Sparkles is just as easy as using one! First of all, let’s connect another one to our chain. We connect the second Sparkle to the right hand side of the first one, matching the +, – and D connections. Notice the direction of the D arrow – it still points away from the Crumble.

Controlling each Sparkle individually is also really simple, in fact if you’ve followed these instructions, you’ve already done this. The number at the beginning of the Sparkle block, 0 by default, represents which Sparkle we want to control. This means that the 2nd Sparkle is ‘1’ and the 3rd would be ‘2’ etc. If you want to change which one you’re controlling, click the white box and change the number – you can control up to 32 of them.

If you want to set all of the Sparkles you’ve got connected to a single colour, you can use the ‘set all sparkles’ block. This sends the information to turn all of the Sparkles to the chosen colour.

Turning them off

It’s all well and good being able to change the colour of a Sparkle, but what if we want to turn them off instead? This is as easy, if not easier than changing their colour.

We can use either of the blocks pictured above, either to individually control one to turn off, or to turn them all off.

There is also another way to turn Sparkles off. You may have noticed already that the colour picker includes black, and for those of you that didn’t know already, we cannot shine a light black. In fact it is the opposite, it is an absence of light. Therefore if we set our Sparkle to be black, it will turn off!

Using RGB Values

The final two blocks that we haven’t covered (for individual Sparkles) are the RGB blocks. These blocks work in exactly the same way as the others, except we don’t use a colour picker to assign the colours, we instead choose how strong we want the red, green and blue emitters to be.

To change the values, click on the number within the red, green or blue boxes – you can insert a value between 0 and 255, 0 being low or off, and 255 being high, or fully on. You can also put variables in here too.

To help visualise the effect of changing the values, take a look at this graphic. The red, green and blue line represent the how strong we want the corresponding colour, between 0-255, and the background colour represents the colour that the Sparkle will produce.

Once you’re comfortable with how to connect and code Sparkles, you can include them in all manner of projects! Remember how we said that you can connect and control up to 32 at once? Well instead of wiring them up individually, we also do a Sparkle Baton (8 Sparkles), a Sparkle Matrix (5×5 grid of Sparkles), and a flexible Sparkle strip (30 Sparkles) all for your shiny pleasure, because let’s face it – you can never have too many lights!

We hope that this has covered the basics of how to use Sparkles, but if you do have any queries or questions, or you spot something that isn’t quite right feel free to get in touch! Get in contact with us via emailFacebookTwitter or our Forum, and we may feature your work!

Comments are closed.