Project Analysis

David Whale sent my Mum some pointers on analysing my recent Pi Wars project so that I could make progress for next year’s competition.  This is an important skill for people like me to learn, who want to work in the computer programming industry when we’re older.  I made notes about my project on the day, and since then I’ve looked at how best to analyse relevant points, so that I can produce a more efficient project in the future.  I can use this template for my other projects, both in advance as well as retrospect.

Project Analysis: PiWars Robot

Construction:

         Pros:

  • The chosen chassis material (laser cut acrylic) was sturdy and supported the hardware well.
  • It was a good idea incorporating pre-cut wiring holes in our design where we needed them, as this made assembly easier.

         Cons:

  • The messy wiring made it hard to locate and fix wiring problems.
  • I didn’t double check the measurements when I laser cut the chassis, meaning that it ended up being the wrong size for our design plan.
  • It was hard to see whether the ball was aligned with the built-in curve or not during the skittles and golf challenges.

         Conclusion:

  • Acrylic makes a good, strong chassis.
  • Pre-cut wire holes are convenient.
  • I need to plan better how to organise the various wires.
  • I need to double check any measurements before laser-cutting the chassis.

 

Traction:

         Pros:

  • The tyres had a decent grip, just not enough power from the motors.

         Cons:

  • The motors weren’t very strong and not able to meet the demands of the competition.

         Conclusion:

  • Strong motors are essential for competing in PiWars.

Power:

         Pros:

  • Our rechargeable battery packs for the Raspberry Pis were convenient size-wise.
  • The motors stayed powered throughout the whole competition using 4 AA batteries. Our LEDs also remained powered for the duration from button cell batteries.

         Cons:

  • The controller pi’s battery didn’t last for more than a few hours between charges, which created problems during the competition.

         Conclusion:

  • We could do with a better power source for the main RPi.
  • Batteries work well for motors and LEDs.

Lights:

         Pros:

  • The lights looked awesome on the robot.
  • They stayed lit throughout the entire competition.

         Cons:

  • The Astro Pi failed to read its program partway through the day, meaning that it got stuck on a static rainbow colour.

         Conclusion:

  • The lights were awesome! We should use similar things again.
  • I should test things like my Astro Pi program more thoroughly in advance, to have time to troubleshoot problems.

Control and Steering:

         Pros:

  • The miniature keyboard allowed me to start programs without scrolling through a list, as I would have to had done if I was using the Wii remote.
  • The keypad doesn’t require manual pairing each time the program is run, unlike the Wii remote.

         Cons:

  • Steering was awkward and difficult using the keypad, which cost me points in the various challenges. Steering with the Wii remote was considerably easier and smoother.

         Conclusion:

  • Ideally, it would be a good idea to combine the two, if possible.
  • For the sake of scoring well in the challenges, the better controller would be the Wii remote.

Attachments:

         Pros:

  • The right sensors were used for each job.

         Cons:

  • I didn’t start testing on the sensors early enough, and was unable to get them to work as needed in time.
  • I should have measured the correct distance above the floor for the line follower.
  • I should have measured the range of the distance sensors before creating the final design.

         Conclusion:

  • Testing the sensors well in advance is vital. This includes getting the correct measurements for each sensor.

Decoration and Style:

         Pros:

  • The robot looked awesome! Jim Darby said that an incredible mind must have designed it!
  • The robot won the funniest robot prize.

         Cons:

  • The decoration got in the way when we needed to access the inside wiring.

         Conclusion:

  • Similar decoration to what we had would be great!
  • We could do with making some of the decoration easily removable for when something goes wrong on the inside of the robot.

Key Points:

  • Early and thorough testing is vital, project plans could help with this.
  • Powerful motors are vital (i.e. proper motors, not beginner kit motors)
  • A responsive, smooth controller (i.e. Wii remote) is important for remote control challenges.
  • TEST WELL IN ADVANCE! That way any problems allow for troubleshooting time.
  • A good power source (i.e. Longer lasting than a mobile charger pack) is important.
  • Tidy wiring is also important.
  • It’s helpful to look at what’s gone right with previous projects, as well as what’s gone wrong.

 

Projects I’ve Been Working On

Hi guys! CrazySqueak here! Today I’d like to show you some of the projects I have been working on.

ProcBeats

procbeats

ProcBeats is a rhythm game made using Processing.

I hit a bit of a snag when I found out that the sound library only works in the 64-bit version though (I was coding on a Raspberry Pi.)  Sadly it means that for now I won’t be finishing this particular project then!

You control the gameplay alone using the 1,2,3, and 0 keys.

You can download the sketch with a test level here.

SkedMan

skedman
SkedMan is a Raspberry Pi only schedule/homework manager for kids and teens.

This is my first program to come with an installer, instead of requiring you to manually run commands.

Install by running the command wget https://www.dropbox.com/s/ey3u1iu11ep3d6v/install.sh?dl=0; bash install.sh?dl=0 in the terminal, and let me know what you think.

SqueakTweets

squeaktweets
SqueakTweets (Internally known as JokeBot) is a Twitter program that tweets jokes every three hours with the hashtag #CrazySqueakJokes.

I did a little video about it as part of the Raspberry Pi Foundation’s Young Pioneers #makeyourideas competition, which you can watch here.

The tweets are posted on the twitter account @CSqueakTweets.

You can download the code to have a look here.

I hope you like my programs! Feedback is always welcome.

My visit to the Raspberry Pi’s 5th Birthday Party

Hi guys! CrazySqueak here with another blog post!

Today, I visited the Raspberry Pi’s 5th Birthday Party, and it was awesome! I got to see a bunch of cool projects and even got some new ideas!

Some of the cool projects I saw include:

  • Wizard Chess (From Harry Potter)
  • An giant operation game.
  • Super Mario Bros 3 running from inside a NES controller!
  • A giant “Raspberry Pi Birthday Cake” with Twitter-controlled lights.

After some time looking at projects, I listened to a talk about creating art with Processing by Matt Richardson. The talk was interesting and I got a cool idea from it. I also went to another talk which was about doing Raspberry Jams and that sort of stuff.

One of the best parts was the trivia quiz show. I didn’t do very well but it was still great fun. Afterwards we got to see what was inside the answer buttons’ box, which obviously included a Raspberry Pi!

Also, I chatted with various people such as Grace (HackerFemo’s Mum who does inclusive jams in London), and Philip Colligan (The CEO of the Raspberry Pi Foundation)!

Another great part was that I received a few free gifts from party bags:

  • A Drum HAT (Cool!)
  • A LED strip HAT (I can’t remember the name and nor can Google)
  • And 2 Blue Ducks (I love ducks!)

I’d also like to get a PaPiRus HAT at some point but we’ll have to order one of those online.

Overall, I think the Pi Birthday was amazing and was definitely awesome enough for such an important milestone. I can’t wait for the next one!

Gallery

Text Adventure Prolouge

Hiya guys, it’s CrazySqueak and I’d like to present the first part of my text adventure that I’m working on.

This text adventure is set in minecraft and has many secrets for you to find.

Install instructions

  1. Download the zip file from my dropbox and unzip into a folder that you have write permission for (i.e. a new TextAdventure folder in your home folder)
  2. If it asks you if you want to overwrite/rename/merge files say to overwrite. This way your save data stays intact between installations.
  3. If you haven’t already installed python 3, do it now by downloading it off python.org (windows/mac) or running sudo apt-get install -y python3 (Raspberry Pi)

Run instructions

  1. Go into the folder that you installed the text adventure to and run the program by double-clicking on it (windows) or opening a terminal window in the current folder, typing in the following python3 textadventure.py and pressing ENTER (Raspberry Pi).

Play instructions

  • When it says press enter to continue, do that.
  • When it says select a save file, enter the number corresponding to the save file you’d like to play.
  • If it is a new save file, you will be asked to enter your name, enter your name or enter a different name if you’re trying to find naming easter eggs.
  • When a > appears, type in an instruction and press ENTER.
  • I recommend that you play this game in a maximised window.

This text adventure is like most others in which you have to type the correct instruction to do stuff.

The rest of the game pretty much explains the most important stuff (i.e. Combat, go, inventory, ect.)

I hope you enjoy my game.

Download here.

EDIT: Fixed a line of code that would’ve caused problems later in development.

My Minecraft Minigames

WARNING: This program is not compatible with PC or Python 2: please use a Raspberry Pi and Python 3 to run

Hi readers, it’s CrazySqueak here, I’ve recently exhibited a few projects at Southend Jam and this is one of them.

I’ve written a Minecraft game called McPiWare. The aim of the game is to earn as many points as possible by completing minigames. The minigames occur in a set order and keep coming until you fail at one of them. There is also a bonus round that first occurs when you reach 20 points, and then it multiplies the score required for the bonus round by three each time. You can find a list of the minigames below.

Name Objective Allocated time (secs) Win criteria Bonus points awarded Notes
 Flowers Pick all the flowers  10
  •  The player has picked all the flowers
  •  (0-5) for speed
 Speed bonus is near-impossible to obtain without cheating
 Parkour Land on as many blocks as possible  15
  •  The player has landed on at least five obsidian blocks
  •  (0-any) for each extra block landed on
 Blocks turn to glowing obsidian when landed on, only landing on normal obsidian counts
 Survive  Don’t fall down 30
  •  The player has at least 1 life left at the end
  •  (0-4) for lives left
 The minigame instantly ends if you run out of lives
 Treasure  Find as much treasure as you can  30
  •  The player has found at least 1 treasure block
  •  (0-any) for extra treasure found
 Searching is done by right-clicking grass near cobblestone or farmland while holding a sword
 Miner  Mine as many diamonds as you can  15
  •  The player has mined at least one diamond ore
  •  (0-any) for extra diamonds found
 You will see text in chat when you are near diamonds, diamons are hidden under the layer of stone
 Bonus (aka Path)  Move from the gold block to the diamond block as many times as you can without falling down  15  You complete this minigame no matter what
  •  (0-any) for paths cleared
  • (0-any) bonus points
 Falling down instantly ends the minigame

I’m really pleased with how this game turned out, especially the built in leaderboard which means you can invite your friends over to compete with you. The leaderboard starts with some pre-set scores so it takes a master of the game to achieve the top ranking score.

Feel free to download and share my project but please leave credit to me for creating the original program. I hope it will be included in the next Minecraft Pi hackpack too!

Having a play around with a bbc micro:bit

I recently acquired a BBC micro:bit from a friend of my Mum’s and I have already started writing a game for it!

What is a micro:bit?

A micro:bit is a cute pocket-sized computer with a bunch of awesome features. You only need a computer with an internet connection and a microUSB lead to program it, which I think is cool.

My microbit
My microbit

What features does it have?

  • A 5×5 LED display
  • 2 buttons
  • A magnetometer
  • An accelerometer
  • A bluetooth antenna for programming via phone
  • A microUSB port for data and power
  • A reset button
  • A connector for a special battery pack
  • 5 I/O connecters (3 General purpose, 1 Ground, 1 3V)

How did I get started and what have I been doing with it?

I first used a microbit at an open day at a Barclays Eagle Lab in Cambridge, where I made a little reaction game. When I got my own microbit, I progressed to writing a small script that drew random dots on the screen. After that I wrote a little script that cycled through the clock/arrow images. I think it’s awesome how something so small can be so versatile!

I’m currently writing a cool battle game that will hopefully have a lot of awesome features.

Picture of my random dots program running
My random dots program running

How do I get started?

First you need to get your hands on a microbit. They’re unfortunately rare at the moment, although they are being given away for free to Year 7 students across the UK, but will go on sale to everyone soon. When you get one, you need to plug it in and calibrate it first of all. It automatically starts the calibration process on start up, and gives you instructions on what to do to calibrate it, then it will run a built-in program until you program it using an external device such as a PC.

How do I program it?

The microbit is programmed in an online environment. I think that is useful for children because they can use it with any computer and don’t need to install software or get their hands on a load of peripherals. There are currently four languages you can program it in and they are as follows:

  1. JavaScript
  2. Block Editor
  3. Touch Develop
  4. MicroPython

Once you have written your program you can download it by clicking the Compile or Download button at the top of the screen. This should open a save dialog. Once you have downloaded your .hex file you need to connect your micro:bit to your computer and move the file to your microbit which should show up as a removable disk.The microbit will then run your program.

saving-program
Saving a program to the micro:bit

To conclude…

Overall, I think the micro:bit is a very useful tool especially for education because it is easy to program and get started with. I have been having a lot of fun programming with it and I hope to keep you updated about what I do with it. I’d love to see what other kids have done with theirs too.

What I’ve been doing on Codecademy

I’ve recently been doing a lot on Codecademy, which is a website where you can learn programming languages by working through free online courses. You can visit the website here.

I have been working through the Ruby and Javascript courses. On Javascript I’ve reached Unit 3, which is about ‘for loops’, and on Ruby I’ve reached part 2 of unit 2 which I’m looking forward to, as I’ve found the course very interesting and educational so far.

You can get started with Codecademy yourself by registering for a free account on the website and finding a course to start.

An overview of my progress

Completed courses:

  • Master the command line

In progress courses:

  • Javascript (27%)
  • HTML and CSS (25%)
  • Ruby (16%)
  • PHP (20%)

 

In my opinion Codecademy is a great learning tool for people who want to learn new programming languages, or learn more about programming languages they already know a bit about. It’s helping me to learn lots of functions that I never knew that I could use in a programming language before.

My visit to Koyoki video games in London

Hi guys, I visited a video games company’s office yesterday (actually the offices of three different companies but they were in the same building.)

I met the person that invited me at Chelmsford Jam (where I was demonstrating some of my projects.)  He’s called David Hasovic and he owns Koyoki Limited.  I thought he was great, and really enjoyed listening to all the things he was able to tell me about the work he does.

We started by seeing the rooftop terrace and then we got round to seeing the offices and having a look at the games.

When I first went into the Koyoki office, I was really surprised and pleased.  I’ve never been in a professional programmer’s office before, so it was exciting for me to see what it’s really like to work as a game developer.  I liked that they are a small company and that their office is nice and quiet – I’d love to work somewhere like that when I’m older.

It was interesting how everybody had their own part of the game that they work on in lots of detail, and to see how much information needs to be stored for various aspects of the game to work.  I got to see processes being used that I’ve only read about in books before too, so that was really interesting.

Everybody was friendly, and I was allowed to pull up a chair or stand next to people, to see what they were working on up close.  They explained to me what they were doing and answered some questions for me too.

The people in Koyoki games were developing a game called Forces of Freedom, which is an army type strategy game played on tablets or mobiles.  You can find it here: forcesoffreedom.com  It’s not the kind of game I would normally play because I’m 10 and there are guns and things in it, but I did get to try out a little bit to see how the program works.  I liked how the sound effects and speed your character is moving at are programmed to change depending on what terrain you’re on.  So if you’re on a bridge, you hear thudding footsteps, and if you’re climbing a hill, your character moves a bit slower – like you would do in real life.

It was a great experience to see how all the files and bits of code come together to create professional games like this, and to learn about how the processes work (e.g. how each person has responsibility for specific parts of the overall program.)

Another company I saw was creating an update for a game called Pocket Mortys (that is actually how it’s spelt, not a me making a typo), which is based on an episode of a TV show called Rick and Morty (you can view the trailer for the app here).  They let me have a go on the apps they were developing as well.

At the end of my visit, David gave me a free book about Refactoring my code to take home with me.  It’s a really big book that I’m looking forward to reading!  I love computer programming manuals and this one should help me to understand how to get my own code to work as best as it can.

I’m feeling inspired to try and set up my own network after my visit, as that’s not something I’ve done before.  I’ll keep you guys posted when I’ve made a start on that. Thank you to David Hasovic for inviting me, and to everyone for being so friendly and helpful.  I learnt a lot and really enjoyed my visit!

Below: Pictures of my visit

Find the block game

Hi guys, I’ve just written a find the block game in minecraft pi that uses the gpio pins. It uses the pins to power LEDs that tell you how close you are to the block. The game tells you how to play before the main part starts.

To play this game, you need to connect some LEDs to the pins, the LED colours and the pins to connect them to are in the table below (Instructions are written for a raspberry pi B+/2/3 so consult your own raspberry pi leaf diagram if your raspberry pi is different):

GPIO pin Led colour
2 Red
3 Yellow
4 Green

You can download my program here.

Install and run is simple, set up the circuit (Remember to use resistors with the LEDs), make sure you have python and RPi.GPIO installed, and run the program normally (Make sure you have Minecraft pi open and a world loaded before running).

The video below is of the game in action.

I hope you enjoy playing my game.