Archive | Getting Started

Getting Started: Pitch Smart Crumb

If you didn’t know already, we have a range of new and exciting components to use with the Crumble: Smart Crumbs. If you don’t know anything about these yet, you can find out more here. In this post, we are going to focus on the Pitch Smart Crumb, which provides a simple and easy way of making music with your Crumble.

Smart Crumbs are just as easy to use as other Crumble components and after reading through this post, we’re sure you’ll be confident and raring to get stuck in making some retro-style music!

The Pitch Crumb, like all Smart Crumbs, requires a connection to power (+ and -) as well as a connection to an I/O port (A, B, C or D). For this example, we’ll connect it up to D, just because it makes our diagram easier to make!

Controlling the Pitch Smart Crumb, whilst still relatively simple, does pose a few more options compared to other Smart Crumbs. As Always, all of the relevant blocks are located within the ‘Smart’ tab.

There are two main ways that you can produce notes/tones with the Pitch Crumb. Either you can set the beats per minute (bpm) and then choose notes by name and duration, or you can choose to generate the tone using the frequency value (Hz), setting a duration by using a wait statement before stopping the note.

Let’s get ourselves started with a simple arpeggio – we’ll use the notes C – E – G – C, with each note lasting one beat at 60bpm.

If we wanted to create the same program, but using the frequency values instead, it would look something like this. You may find the notes to be ever so slightly different – this is because the true frequency of notes go into multiple decimal places, something which the Crumble cannot currently handle.

The main benefit of using the frequency block to manually select the notes we hear is that we can ‘generate’ more interesting sounds. Take this sound effect as an example. We’ve used the ‘random’ block to select the pitch of the note, as well as the length, providing us with sort of robotic loading sound.

The Smart Crumb: Pitch opens up an area which hasn’t existed on the Crumble before. Yes we’ve had buzzers providing a way of generating sound, but they can only produce one note. Now we are only limited by our hearing (roughly)! Welcome to the new world of simple melodies, doorbells, warning sirens, robotic voices and more!

We hope that this has covered the basics of how to use the Digits Smart Crumb, 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 emailFacebookX or our Forum and we may feature your work!

Getting Started: Digits Smart Crumb

If you didn’t know already, we have a range of new and exciting components to use with the Crumble: Smart Crumbs. If you don’t know anything about these yet, you can find out more here. In this post, we are going to focus on the Digits Smart Crumb, which is a new output for the Crumble controller, made up of four 7-segment displays. This means that you will now be able to display values between -999 and 9999.

A Smart Crumb is really simple to use and after working your way through this post, you’ll be up-and-running in no time at all!

The Digits Crumb, like all Smart Crumbs, requires a connection to power (+ and -) as well as a connection to an I/O port (A, B, C or D). For this example, we’ll connect it up to D, for the simple fact it makes our diagram easier! 

Controlling the Digits Crumb is as easy as you would imagine and there are two relevant blocks, located within the ‘Smart’ tab in the Crumble software.

Let’s start with a simple program to check that all of our connections are good. This program will display the number 1234. If you aren’t seeing this, double check the wiring as well as the program.

As with all blocks with an editable number, we can instead use a variable to denote the value. This leads onto many more exciting possibilities.

Here we have a simple timer which starts counting up from 0 when the Crumble is powered on. You could then extend this to be resettable with a switch, or triggered by a specific event.

Remember when we said that it could display -999 to 9999? But what happens if my variable that I want to display is outside of that range? I hear you cry! Fear not, there are some built in symbols to alert you of this. If you try and go over the limit, you’ll be met with four lines along the top edge of the digits.

And we bet you can’t guess what happens if you go below the lower threshold? Yep, you guessed it – four lines along the bottom edge of the digits.

The Smart Crumb: Digits opens up a massive whole new world of possibility. Now that we can finally display variables in a meaningful way, all without being tied to a computer, we can create all manner of great projects. A stopwatch, score counter, coupled with the Smart Crumb: Temperature we can make a digital thermometer, or even by using two of them and a pair of switches we could make a game of numerical snap!

We hope that this has covered the basics of how to use the Digits Smart Crumb, 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 emailFacebookX or our Forum and we may feature your work!

Getting Started: Temperature Smart Crumb

If you didn’t know already, we have a range of new and exciting components to use with the Crumble: Smart Crumbs. If you don’t know anything about these yet, you can find out more here. In this post, we are going to focus on the Temperature Smart Crumb, which, probably pretty obviously, enables us to measure and utilise within our Crumble programs the temperature in °C.

Each Smart Crumb is simple to use and after reading this post, you should easily have the basics nailed! Let’s start with connecting it to the Crumble.

A Smart Crumb needs a connection to power (+ and -) as well as one to an I/O port (A, B, C or D). We’ll connect ours to D, simply because that way we get a more aesthetically pleasing diagram! You’ll also need to wire up a battery pack to your Crumble too.

Now we can look at how to find the temperature and use this within a program.

First of all, locate the ‘Smart’ blocks section in the Crumble software. Here you will find all of the relevant blocks needed to control and use Smart Crumbs.

Now let’s run a simple program so that we can see the data we’re getting out of our temperature sensor. With any luck, when you flick to the ‘Variables’ tab you should be able to see the temperature.

Try grasping the Smart Crumb in your hand; the temperature should rise. Then when you let go again, it should fall. Although you can use the ‘temperature on x in °C ‘ block as a variable/integer, it is good practice to create and use a separate variable within your program e.g. we’ve used ‘t’. This is so that we can monitor what happens with the value and debug more easily (e.g. if there is data shown, we’ve wired it up correctly).

From here, we can easily embed our temperature sensor into any project we wish! Thermostat-controlled fan? Coolbox alarm? Investigation into which materials make good thermal conductors/insulators? These are just a few ideas to get you started!

We hope that this has covered the basics of how to use the Temperature Smart Crumb, 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 emailFacebookX or our Forum and we may feature your work!

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!

Getting Started: Flashing the Motor LEDs

One of the very first things you can do when you get started with a Crumble, is to flash the Motor LEDs. This is pretty much the ‘Hello, World!’ program within the Crumble ecosphere.

It’s really easy to do, and it doesn’t require anything other than a Crumble, micro USB lead and a computer with the software installed.

So to get started, connect the USB lead into your computer, and connect that to the Crumble.

Now, if you haven’t already done so, open up the Crumble software. To get a motor LED on, we’re going to run the following program. Drag the blocks from the toolbar, connect them together, and hit play when you’re ready.

All being well, you should see a message telling you that programming was successful. Take a look at your Crumble – you should see that the motor LED is now on. Well done for writing your first Crumble program!

Now let’s move onto flashing the motor LED. As before, drag your blocks over and have a go at writing the following program. Before you run it, think about what it might do.

Hint: You can change/edit parts of blocks that are white or grey – click on the word ‘forwards’ to cycle through to stop.

Hopefully your motor LED is now flashing away. If you want to make the other side flash, simply click on the ‘1’ in the motor block, and it will change to 2!

Programming the Crumble is as easy as that! When you feel comfortable, you can move onto connecting the battery pack along with other components, like Sparkles, switches buzzers etc. If you want any ideas or inspiration for what to make, check out our blog or project pages.