Author Archive | Daniel

The Crumble at New Scientist Live

Last week saw us attend what is coined as ‘the world’s greatest science festival’. Over 40000 people attended across the four days, and made, what turned out to be an amazing show.

We had never been to, let alone exhibited at New Scientist Live (NSL) and as such, we were not sure how successful or useful the show would be. We’d ended up being at the show, after it was suggested to us that the Global STEM Award and the Crumble would fit in well. So we thought about it, and gave it a shot.

We ended up having a fantastic time, not just looking around the show, but talking to, and interacting with so many wonderful people! It’s lovely to watch children and adults alike being enticed in by a plethora of exciting Crumble activities.

UKSTEM were on the stand with us, talking about the Global STEM Award, and showing off their latest developments (which will be announced soon). For the vast majority of the show, we were swamped with people!

Mike from UKSTEM talking about the Global STEM Award

For the Crumble parts of the stand, we decided to work on making it look more exciting and fun to use. As we were in the lunar section, we went with a ‘spacey’ theme. We had two main Crumble activities – the first was to pre-program a lunar vehicle to get from one area of ‘the Moon’ – to another.

A Crumble Buildbot on our lunar surface

And the other was to recreate a light signal, which was shown to you on a matrix display. After programming a Crumble, you ‘docked’ it onto the giant matrix display to see if you had gotten the pattern correct!

Our giant Crumble Matrix

All in all, we had a brilliant time over the four days. We had many interesting conversations with people about the Crumble, our mini dataloggers and the Global STEM Award. and I definitely think that we will be exhibiting next year.

NCW Day 5 – Game Time!

Welcome to our fifth and final blogpost from our National Coding Week special. If you’ve missed any of the other four, or want to find our more about what we’re doing, and why we’re doing it, then head over here to find out more.

This final post, as mentioned previously, is all about playing a game. We are going to combine together each of our previous elements, and turn them into something playable! To recap, we’ve got the Colour Picker, the Dice, the Letter Spinner and the Countdown Timer.

Before we get into the fundamentals of the game, we are going to combine together each of our individual elements, so that at the push of a button, our game runs! If you remember, each of our projects shared the fact that they were started at the push of a button, or when the I/O pad was HI. By tweaking each project to turn an I/O pad, connected to another Crumble, to HI at the right moment, we can cause a chain reaction! To get a better sense of what is going on programmatically, lets look at our new Colour Picker code.

Notice the addition at the end of the code. We’ve set C HI, which is connected to A on the next Crumble (running the Dice program). We then wait 100ms and set it LO again.

We’ve changed each program (apart from the Countdown Timer) so that it runs the additional code snippet after it’s finished it’s main purpose. We have changed the Countdown timer code so that it doesn’t wait for another input to reset the servo, rather it resets itself after a few seconds.

To get this to work correctly, we need to have common grounds (-ve). The easiest way to do this, like we have, is to use a single power supply.

This is only one of the ways to connect your projects up.

Lets look at the chain reaction in action!

Now we come to the game, which is played as follows. The aim is to come up with as many words as you can, which are as long as the number on the dice, within the time limit (one and two may be tricky, so you could remove them). The colour at the beginning relates to a bit of a forfeit which takes place during the round. These are as follows:

  • Red – Scattergories mode. If any of your words are the same as anyone else’s, they don’t count for anyone! You need to be unique to win.
  • Green – Hand switch. Swap your usual writing hand, for your non-dominant one.
  • Blue – Shout it out. Every time you write down a word, you have to shout it out.
  • Yellow – Normal. No bizarre rules, just write down as many words as you can.

Let’s look at an example.

Here we’ve ended up with green, five and G. This means that we need to write as many five letter words as we can, that start with the letter G, in 30s. But we have to do it with our non-dominant hand, so in my case I would swap to my left hand to write with.

And there we have our game ready to play! Clearly you aren’t limited to this version of the game. There’s a plethora of possibilities out there using these examples or combinations of your own.

If you have a go at this project, or any other, we’d love to see! Get in contact with us via emailFacebookTwitter or our Forum.

NCW Day 4 – Countdown Timer

Welcome to our fourth blog post, in a series of five, in celebration of National Coding Week. If you haven’t already, take a look here to find out more about what we’re doing, and why we’re doing it.

The next part of our game is going to be a countdown timer. The aim of this project is fairly self explanatory. Our game requires a time limit, so what better way to keep us within the time limit than with a timer not dissimilar to the one from Countdown!

For this you will need:

For the eagle-eyed amongst you, you may realise that we have already done a Countdown Clock Project. This is going to be an updated version of it, but we will go into less depth with the programming. If you are unsure of why we did something, go and check out the original post for help.

To begin with, we are going to connect together the components. Connect the +ve and -ve on the battery box to the respective connections on the Crumble (left hand side). Make sure to keep the batteries switched off for the moment.

Now we are going to connect our servo. This requires a +ve and -ve connection, which we can take from the right hand side of the Crumble, and then one I/O pad; we’ll use D, to keep the wiring neat!

To get the basic servo-powered timer working, we need to think about what we are trying to achieve. Let’s say that that we want the timer to last for 30 seconds. During this time, the servo needs to travel 180 degrees, from the top of the clock face, to the bottom. Therefore our servo needs to travel 180/30 degrees (=6) every second. We can achieve this using a variable and a loop. We set our servo to 90, then every second, we subtract 6 from the servo angle and re-set it.

To make this switch controlled, we can use a similar method to our previous NCW projects. Within a loop, we wait until A is HI before starting our timer code. We then have another ‘wait until A is HI’ after our main timer code, which works in such a way so that the servo resets and waits to be started again. You’ll notice the extra wait statement – this allows the servo to ‘reset’ before you press the button to start it again.

Given that it is unlikely that the players will be looking at the clock, we can also add in a buzzer to give us an audible cue as to how much time has passed. This will also help ramp up the pressure, making the game more exciting! We’ve connected the buzzer to B, and to the negative pad on the battery box. This means that when we set B HI, the buzzer will sound.

To use this within our program, we need to turn on the buzzer, and turn it off again in between setting the servo angle (our original timer code). The total amount of time we need to be waiting, still needs to be equal to 1 second (buzzer on for 0.2 seconds, and off for 0.8). Notice where we have turned the buzzer on towards the end. This sounds the buzzer continuously until the clock is reset. This is useful to know when the time is up!

We now have a working 30s timer! Although the servo isn’t very useful at the moment, so we are going to embed it with our Countdown Clock Template. For instructions on putting this together, head back to our original project page.

And there you have it, a 30s Countdown timer!

If you have a go at this project, or any other, we’d love to see! Get in contact with us via emailFacebookTwitter or our Forum.

NCW Day 3 – Letter Spinner

Welcome to our third blog post, in a series of five, in celebration of National Coding Week. If you haven’t already, take a look here to find out more about what we’re doing, and why we’re doing it.

The next part of our game is going to be a letter spinner. The aim of this project is to randomly choose a letter of the alphabet, spread around, by way of a large spinning arrow. We will borrow from the foundations of our Probability Spinner Project and tweak it.

For this you will need:

For starters, we are going to connect together the components. Connect the +ve and -ve on the battery box to the respective connections on the Crumble (left hand side). Make sure to keep the batteries switched off for the moment.

Now we are going to connect a motor, with the pulley attached. You can use either motor connection on the Crumble, but we’re using motor 2. Connect the red lead of the motor, to the + on the motor pad, and the black to the – .

Getting our motor to move is simple, as is getting it to stop, but we want to make it spin for a random amount of time. To do this, we can use the ‘random _ to _’ block; a common occurrence throughout this blog series. When the Crumble receives power, we will give ourselves 2 seconds to move our hand away, then we will turn the motor forwards. We will wait a number of milliseconds, between 3000 and 9000, and then stop the motor.

To make the spinner easier to use, we can use a push switch to trigger the spinner. This connects to a + connection, and an I/O pad (A, B, C or D).

As with our previous posts we are going to ‘pause’ the program and wait until the input (D) is HI’. Once the switch is pressed, the program continues and our spinner code will run. All of this will then be inside a loop, to allow for infinite letter choosing! Or until the batteries run out, or we get bored.

Although this spinner is perfectly adequate, to make it more realistic, we want it to slow down gradually. We are going to add a variable called ‘Speed’, which will start at 100 (%). When the spinner is due to stop, we will run a loop which subtracts varying amounts from ‘Speed’, bringing the motor to a gradual-ish stop.

Hint: we use the condition ‘if speed < 1’ as the speed value may not equal 0. If we didn’t, the value could become negative and the motor would begin speeding up in the other direction!

And there we have a our letter spinner ready to rock!

If you have a go at this project, or any other, we’d love to see! Get in contact with us via emailFacebookTwitter or our Forum.

NCW Day 2 – Dice

Welcome to our second blog post, in a series of five, in celebration of National Coding Week. If you haven’t already, take a look here to find out more about what we’re doing, and why we’re doing it.

The next aspect of our game involves a random number selection, and in our case, digital dice. There are a few ways you could go about this, but we are going to use the Matrix display to represent the dots, as it is already in a nice grid.

For this you will need:

First of all, we are going to connect together the components. Connect the +ve and -ve on the battery box to the respective connections on the Crumble (left hand side). Make sure to keep the batteries switched off for the moment.

Next, we need to connect the Matrix Display. Connect the remaining +ve and -ve on the Crumble to the corresponding connections on the Matrix board. Looking at the Matrix board with the text the correct way up, it’s the pads on the left-hand side. Then connect D from the Crumble to the board – notice the direction of the D arrow, it should point away from the Crumble. If you are using the Matrix Pixelator, you may need to look carefully at which way around your board is in the holder.

Before we come to write our code, we need to work out what our numbers (or spots) will look like. It can be a good idea to plan this to save confusion later on.

Now we come to writing our code. This program is similar to the colour picker from yesterday, but instead of assigning a single colour to a value, we are going to assign an ‘image’; or multiple Sparkles. Lets start, as before, with two choices. We’ll look at choosing either 1 or 2. First of all, lets get our variable set up.

Now we can add a condition in. Remember that we can use the ‘IF ELSE’ statement as our options are mutually exclusive; our ‘RandomNumber’ cannot be one and two at the same time! If the generated number is one, then we want the Matrix display to show one, otherwise the generated number must be two and so we want to display two on the Matrix. We’ve also turned off all of the Sparkles at the beginning, which makes sure that our Matrix is ‘reset’, and we’ve got a wait statement, which gives us time to move our hand away from switching on the power.

Now we want to extend our code, as before, to have as many options as we require (6), and so that we can choose our number at the push of a button. Wiring in a switch is simple. One side connects to a free +ve connection, and the other to an I/O pad on the Crumble – we’ll go for A.

Using the switch within our program is easy. Put your code within a ‘do forever’ loop, so that it runs indefinitely whilst the Crumble is powered, and then we can use a ‘wait until’ block. This behaves like a pause in our program, so that it won’t move on until the condition is met, which in our case is when the button is pressed and A is HI. The wait statement from earlier comes in useful here too, as does clearing the Sparkles.

And there we have our digital die, ready to roll (excuse the pun)!

If you have a go at this project, or any other, we’d love to see! Get in contact with us via email, FacebookTwitter or our Forum.

NCW Day 1 – Colour Picker

Welcome to our first blog post, in a series of five, in celebration of National Coding Week. If you haven’t already, take a look here to find out more about what we’re doing, and why we’re doing it.

The first aspect of our game is going to be a colour picker. The aim of this project is to set a Sparkle to a random, but predetermined colour. Or in other words, choose from a set choice of colours (that we have programmed). This could then go on to be used to pick an option from a list or a team to take part etc.

For this you will need:

First up, we are going to connect together the components. Connect the +ve and -ve on the battery box to the respective connections on the Crumble (left hand side). Make sure to keep the batteries switched off for the moment.

Next, connect your Sparkle. Connect the remaining +ve and -ve on the Crumble to the ‘in’ on the Sparkle (the D arrow should be pointing to the right). Then connect D from the Crumble to the Sparkle, taking care to get the direction correct, as previously mentioned. Use the diagram below if you’re unsure.

Now we come to writing our code. To begin with, we are going to randomly choose between two colours. To do this, we want to think about assigning each of our colours a number – starting from zero e.g. Red = 0, Green = 1.

At the the beginning of our program, we want to choose a random number within the range of our list. So either 0 or 1. Once we have chosen the number and ‘remembered’ it (by assigning it to a variable), we can work out what colour to set the Sparkle.

This is achieved by a series of selection (or ‘IF’) statements – basically questions. In English, it would be ‘If the random number is 0, then make my Sparkle red’. Notice the wait statement – this just allows us time to get our hand away from the switch, but it also gives the illusion that the Crumble is ‘thinking’. Also notice where we turn the Sparkle off at the beginning. Whilst the Sparkle has power, it remembers the colour it was last told to be. Although at the moment we are using the battery pack to switch on and off, we will need this in the future, so it’s good to put it in now.

We could repeat this for the other colour, changing the numerical value and the colour of the Sparkle, and this works just how we want it to.

However, there is a bit of redundancy within our code. As our two conditions (if RandomNumber = 0, and if RandomNumber = 1) are mutually exclusive (they can’t both be true), we don’t need to check the second condition. If the ‘RandomNumber’ doesn’t equal 0, then it has to equal 1 (as long as the random number generation is correct). Therefore, the best way of writing this code is as follows.

From this point on, it should be easy to see how you would extend this code to choose between even more colours! See if you can choose between 4 different colours?

We have a working colour picker, but at the moment it only works once. So, instead of triggering our program by powering the Crumble on, we can add a push switch instead. This way, we can repeatedly generate our colour! If we connect up our switch to A (and a +ve connection), it’s really simple to add in the code to start our colour picker.

We have used the ‘wait until’ block, which halts the program until A is HI (the button is pressed). Our wait statement now also gives us time to remove our finger from the switch. If it wasn’t there, we could repeatedly choose a random colour, and it would be impossible to use. We’ve also put our code inside a ‘do forever’ loop. This runs the code indefinitely, whilst the power is on. Turning off the Sparkle is now really useful! Not only can we see the new colour when the Sparkle lights up, there is no confusion if the colour picked is the same as last time.

And there we have our colour picker!

If you have a go at this project, or any other, we’d love to see! Get in contact with us via email, FacebookTwitter or our Forum.

National Coding Week – Blog Special

Next week is National Coding Week, and we thought to celebrate this, we would release a series of blogs dedicated to a project theme. This time we have chosen ‘games’. Each day there will be a new blog post detailing how to create a simple game-related project. Then at the end of the week, each one of these projects will connect together to form a game, which we will go into more detail on Friday.

As it stands, here is our current plan of action: Monday – colour picker using a Sparkle; Tuesday – dice using a Matrix display; Wednesday – letter spinner; Thursday – audible countdown; and Friday – Playing the game!

Each individual blog (apart from Friday) aims to provide you with a small project that you can do discretely, and then if you complete each one, you will be able to combine the smaller projects into a form of game.

Like other initiatives, National Coding Week is designed to encourage people of all ages to try something new, around the theme of coding/programming. There is a massive emphasis that not just schools get involved, but individuals and businesses too! You can find out more on their website.

If you have a go at any one of these projects, we’d love to see! Get in contact with us via email, FacebookTwitter or our Forum.

NCW Day 1 – Colour Picker

Welcome to our first blog post, in a series of five, in celebration of National Coding Week. If you haven’t already, take a look here to find out more about what we’re doing, and why we’re doing it. The first aspect of our game is going to be a colour picker. The aim of this […]

NCW Day 2 – Dice

Welcome to our second blog post, in a series of five, in celebration of National Coding Week. If you haven’t already, take a look here to find out more about what we’re doing, and why we’re doing it. The next aspect of our game involves a random number selection, and in our case, digital dice. […]

NCW Day 3 – Letter Spinner

Welcome to our third blog post, in a series of five, in celebration of National Coding Week. If you haven’t already, take a look here to find out more about what we’re doing, and why we’re doing it. The next part of our game is going to be a letter spinner. The aim of this project […]

NCW Day 4 – Countdown Timer

Welcome to our fourth blog post, in a series of five, in celebration of National Coding Week. If you haven’t already, take a look here to find out more about what we’re doing, and why we’re doing it. The next part of our game is going to be a countdown timer. The aim of this project […]

Growing Plants Under LEDs

This project is one of the activities that makes up part of the Global STEM Award’s coding route.

In the future, it may be the case that the Human race begins to settle on another planet – probably Mars. We will inevitably need to grow food, as you can only carry so much, and with a journey taking around seven months, emergency rations wouldn’t arrive quick enough!

Scientists are certain that areas of Martian soil do contain the right levels of nutrients to grow plants, but unfortunately the climate isn’t conducive to horticulture. At the height of summer, temperatures near the equator only just reach 20 deg C. Not too bad – but over night they still plummet to an eye-freezing -73 deg C. Just a reminder, this is Summer. At the equator. The warmest part of the planet!

So if growing plants isn’t an option outside, where else can you grow them? Well it would be possible to set up greenhouses, but they would need a lot of protection and heat to keep the plants going. You could also bring the plants ‘indoors’ – setting up growing stations mixed in with living quarters, the environment would already have to be the right temperature, and the plants will assist with air purifying. Another option would be to head deep underground, where geothermal warmth could be used, but then you are posed with another issue – plants need light. Where is this going to come from?

Using the Crumble, along with some Sparkles, we’ve had a look into growing plants under artificial lights. We initially set up a tester investigation to see whether or not there would be a difference, and whether the plants would grow at all! We decided to use some cress as it is easy to grow, and it has a short germination time. We left one pot in the sunlight, another covered up, and another three covered, but with a Sparkle shining inside (one Red, one Green, and one Blue).

Our initial test was very positive, so we have upscaled the investigation. We know that plants grow well in the spectrum of light produced by the sun as they have likely adapted themselves to do so. But there is a question as to whether they prefer a certain colour of light. We are going to look at how well cress grows under different colours of light.

dav

Our first step was to create an open-fronted enclosure for the pots (which we’ll come to later). As we wanted to grow a larger amount of cress, we have used two Sparkle Batons, but if you wanted to do this on a smaller scale, with lots of groups, you could easily use some paper cups and individual Sparkles. The spacing was set so that there were two Sparkles lit with each colour, on each baton, so four in total. This means that there are two unused Sparkles on each baton. The Sparkle Batons are loosely held in place, with a piece of card and some split pins. This is enough to prevent it moving.

Once we had our container made, we decided to draw and 3D print some custom pots and water trays, to get the most out of our growing space. We filled these with some damp compost, and sprinkled 0.2g of seeds across each one.

We then put the filled pots into our divider, and connected our Crumble. The code running on the Crumble isn’t too difficult. Put simply, we are turning on the Sparkles we need, to the colours we want. After a set amount of time, we turn them off (to simulate night time) for another period of time. The amount of time that we wait is determined by how many hours we want the Sparkles to be on for.

Once set up, we switched on the Crumble and waited. During the course of the investigation, we routinely inspected the plants and made sure that they hadn’t dried out. It is worth noting that we set up our test in a dark cupboard, to make sure that we were only using the Sparkles as a light source.

We had a go at capturing the first few day’s of growth. Each fade represents the night time and is shortened as you cannot see anything!

When the seed is in the soil, you don’t get to see the moment it germinates, so we thought that we would have a go at capturing that moment. Notice how the seed swells as it hydrates, before it splits open and starts growing.

Which worked the best can be difficult to determine – you cannot just go by a plant’s height. When a seedling doesn’t get enough light, it rapidly grows taller, in search of light (often described as leggy) and it takes on a rather yellow colour. A healthy cress plant shouldn’t be floppy or spindly, and it shouldn’t have any yellow tinge to it at all. In fact, working out which is best is rather subjective, but the easiest way is to see which one ‘looks the healthiest’.

To work out which colour of light was the ‘winner’, we took into account the height of the plant and looked at how green the leaves were. We took a picture, with no filters or effects, and in natural daylight, which we then uploaded into an image editing program. Using the software, we used the colour picker to work out the green RGB level . By taking an average of 4 different leaves from each section, we got the following results: Green – 87.25; Blue – 95.25; and Red – 130.25. This tallies with our visual analysis – which pretty much tied the Red and Blue plants. Unfortunately, we have ended up with a large amount of soil on top of the Red cress, making it harder to see.

Blue – Red – Green

From our first investigation, with only a few seeds, we found Blue light to be the best, and Green to be the worst. So the common result that we have found is that Green is the worst light to grow under.

This isn’t the only way you could combine plant growing with the use of Sparkles. You could try combinations of colours, more/less ‘night’ etc. You could even use low-power heating devices like a peltier cell to adjust the temperature of the soil.

If you have a go at this project, or any other, we’d love to see! Get in contact with us via email, or on FacebookTwitter or our Forum.

Community Spotlight: Problem Solving Club

Through multiple conversations we’ve had with people over the last 18 months, we have known for a long time that we’ve wanted some kind of ‘community’ blog. This would be a place for us to share and showcase the fantastic work that you’ve all been doing with the Crumble.

Our first guest in the Community Spotlight is Sway Humphries (née Grantham). After having a chat with Sway at Raspberry Fields back in 2018, we had come to the conclusion that we definitely wanted to showcase the ways in which the Crumble was/is being used. Sway told us all about the fantastic ideas that her pupils had been having, and that she would send across some videos. Fast forward seven months, with everyone having seemingly forgotten, we received an email. Sway was at BETT and suddenly had a Crumbly epiphany. Attached was the information for a blog, so here goes!

The following footage and ideas stem (excuse the pun) from a group of 7-9 year olds, taking part in a ‘Problem Solving Club’. All of the creations were planned and created in a single session!

First up, we have a ‘Flood Defence System’. When the water level gets too high, the alarm sounds.

The Flood Defence System in action

Next, we have a ‘Fire Navigating System’. When there is a fire, the alert is switched on and it shows you which way to go to get to the nearest exit.

The Fire Navigating System being put to the test

Finally, we have the ‘Stress-o-meter’. Every time something stressful happens in the day, you press the button, and the scale, as shown on the Sparkle Baton is increased. When the meter reaches the top, a separate LED worn on a wristband is switched on. This then alerts everyone else not to give you any more bad news as it’ll all be too much!

The Stress-o-meter showing us when to steer clear!

As you can see, all of these ideas are fantastic – and given the fact that they were planned for and achieved within one session is incredible.

If you have any great work you want to share with us, get in touch!

Pi Wars: a Story

Back in the summer of 2018, Joseph and I found ourselves at a ‘super secret’ meal after the first evening of Raspberry Fields. Apparently, staying in the same seats for the duration wasn’t allowed, and as such, we chatted to a few different people. Luckily, for our dessert, we ended up sitting opposite Michael Horne and Tim Richardson – famed for creating the infamous Pi Wars robotics competition. I had heard about the event on Twitter, and was especially interested in having a go.

To cut a long story short, I was very keen to take part! Furthermore, Joseph was definitely up for sponsoring the event with some prizes.

The good news came on the 30th of September 2018. Our application had been successful and we were set to compete in Pi Wars 2019! I was to take the reins on our entry, as Joseph is a very busy person, and as I was fairly new to python, it would be a great learning experience.

“I knew it was going to be challenging, but I hoped it would be rewarding as well”

The process of learning how to do any of this was going to be quite extensive. I’m a Raspberry Pi Certified Educator, and I had tinkered with the Pi on the odd occasion, including making a Wiimote controlled vehicle using the CamJam kit but I had never completed anything beyond this. I knew it was going to be challenging, but I hoped that it would be rewarding as well. One of the best ways to learn a programming language is to use it in context; a real application.

When discussing ideas for the robot (before we had applied), Joseph had mentioned that there was a Python library to control the Crumble over USB. This was brilliant. We could use the Pi for all of the processing power (to stick within the rules!) and the Crumble could be used as our Motor Driver board, and power any Sparkles we may want to attach.

My first step was to focus on learning Python. I’d become familiar with a couple of written/block-based languages in the past, and I had even gotten halfway through a Python course, but unfortunately it had been a while so I needed to start from scratch. I made it part way through an Udemy course, and then I started and completed the free Python course from Codeacademy. This was a big step for me. I had reached the end of a programming course, and I was feeling much more confident in getting started.

“After swearing I would get started before Christmas… January arrived”

After swearing that I would get started before Christmas, and not do my usual procrastinating, January arrived. It was very busy – we were heading to BETT this year to exhibit. I knew I wasn’t going to get started until February. As a part of a conversation with our Spanish distributor for the Crumble (Complubot), Joseph had been made aware of something very useful – The Pixy Cam.

After getting back from BETT, we looked into the Pixy2. It looked incredibly easy to use, it could detect coloured objects and lines, and it was possible to interface with it via Python – perfect! We purchased the camera, along with a pan and tilt mechanism, and couldn’t wait to get stuck in.

The included software for the camera was simple to use, and offered some great features – especially when it came to tweaking the camera’s settings to recognise colours (signatures) and lines (vectors). One of the steepest learning curves, however, involved interfacing with the camera via Python. It seemed that the device was much more suited to controlling via an Arduino than a Raspberry Pi, and as such, it was hard to find a great deal of information about using it with Python.

As a part of the installation process, four example Python programs were generated. I would rely heavily on these to work out what to do!

I was becoming overwhelmed with the ever-decreasing time left, and this caused me to take some drastic action – a mind map! I planned a very basic chassis to get something moving, and then wrote down what steps needed to be completed before the big day. This is called decomposition – breaking down a problem into smaller, more manageable pieces.

“I was feeling much better about the still mammoth task ahead”

One of my first steps was to control a motor connected to the Crumble, by using Python This would become my ‘Hello World’ style program. After this small, but important step, I was feeling much better about the still mammoth task ahead.

The remote control portion of the project was quickly finished – I had used the ApproxEng library for connecting to, and controlling motors, in the past, so it didn’t take much to adapt the code to work for the Crumble. Theoretically, that was the programming completed for half of the challenges!

The steepest learning curve, and the point at which I repeatedly questioned why I was doing any of this, was programming the autonomous challenges. After tinkering with the example Python programs, I decided to start with the Line following program. This wasn’t too difficult to do – I had experience with various algorithms for line following. Once I had worked out what information I could use from the Pixycam, it all fell into place quite quickly! After this, I set to work on driving towards a colour signature. This was with the autonomous maze in mind as I felt that this would be more challenging than the Nebula. Once I had the working maze code, I could reuse elements of it to help recognise, and correctly approach the four colours in the Nebula task.

I learnt a lot whilst programing these challenges:

  • Things fail – a lot. I spent a lot of time thinking, staring at code trying to make sense of why it wasn’t working.
  • Take breaks. I regularly found myself slumped at my desk, getting increasingly frustrated. I stopped, came back to it the next day and more often than not, immediately solved my issue.
  • Don’t be afraid to redo something. Some of the functions I had written were messy, and didn’t work properly. A whole new line of thinking enabled me to produce better, and more efficient code!
  • Not everything has to be perfect. This is was an amateur robotics competition, of which I am a beginner. It was better to have something clunky but working, than something that doesn’t work at all. The day before the competition, in consultation with Joseph, I decided to put my ‘fancy’ maze following code to bed, and develop a simpler version. Given that the maze was preset, and we had access to the plan, why would I even bother looking for the next alien to the left, if i knew it was a right turn?

We both thoroughly enjoyed our time at Pi Wars. It was a day of both success and failure, but it was a very rewarding task to undertake. I managed to battle my way through to the Grand Final of Pi Noon ( a 1v1 balloon popping battle), coming second after a close final. But more surprisingly, we won the beginner category! Our slow, solid and steady Crumble Robot had powered its way round to victory!

Here are just a few pictures from the day!

This whole experience has proven that one of the best ways to learn programming is to give it a context. Trying to learn something whilst not giving it a real-life context makes it very difficult, and it doesn’t ‘stick’. It is worth mentioning that this is one of the main ideas behind physical computing – blurring the lines between a computer and physical components and pieces. Programming and controlling something that you’ve made yourself gives you a fantastic feeling, and I definitely have a stronger urge to continue, more so than in the past.