Week 5 2018 Explorers – How fast can you type?

Hi everyone,

Thank you all for coming on Saturday. I hope you liked the short video of the SpaceX Falcon Heavy Test Launch and the Intel Light Drones from the opening Ceremony of the Winter Olympics.

This week we did a new game, How fast can you Type? Last week we used Sprites as backgrounds and this week we used Backgrounds as Sprites. Just to mix it up!

We used a variable as our Timer, our first time doing this, don’t forget if you want the time to start when you press the first letter rather than when the green flag is clicked then you are going to have to add another broadcast.

We are off for the next two weeks, to cover the school mid term break and also as Confirmation for all the Athenry Schools takes place on the 24th of February and there will be many families attending this from Coderdojo Athenry. Best wishes to any of our Ninjas and families who are being confirmed.

Hope you all have a great break and hope to see you all back on the 3rd of March

Hackers – Remote Controls for Our Bots!


In the Hackers group this week, we took a large step forward in our Project SABRE (Small Autonomous Battling Robotic Entities), when we started working with remote controllers for our robots.


From what the group has read, it looks like the most widely-used controllers are Spektrum-compatible DSMX or DSM2 ones. Therefore, we bought 3x Lemon RX DSMX/DSM2 receivers and one MLP4DSM Blade transmitter (as shown in the photo).

Connecting to the Arduino

Pins on the receiver are simply connected to digital pins on the Arduino.

To program the Arduino to read the receiver, this code has been cross-referenced from other forums: https://www.sparkfun.com/tutorials/348

According to the comments, while this works, you should use interrupt-driven code.

This StackExchange post has a good list of possible references:


There was a lot of excitement when people were able move the joystick on the transmitter and have it change the value being printed out in the Arduino console!

Hackers – Building Battling Bots for Project SABRE!


In recent weeks in the Hackers group, we have been refining our plans for Project SABRE (Small Autonomous Battling Robotic Entities).

Our mission for Project SABRE is to build “battlebots” that include some autonomous features. While there are many kits available for purchase, our two teams of hackers are designing and building their bots from scratch, identifying and sourcing all components ourselves, 3D printing bodies of their own designs, and programming everything themselves. Even the mentors are hands-off, helping mainly with project planning and purchasing, but not designing or making.

The main components required are:

  • 2 or 4 motors with wheels or tracks
  • Battery packs and chargers (salvaged from old toys)
  • An Arduino
  • A motor driver board or chip — these work just like the transistor circuit that we experimented with previously, but can control up to 4 motors and drive each one forwards or backwards: https://coderdojoathenry.org/2017/11/22/hackers-a-joule-thief-and-controlling-motors/
  • A servo motor if needed for a flipper arm
  • A 2.4 GHz radio transmitter and receiver

Stay tuned as the work continues in the coming weeks!


Creators: Spirograph

This week in the Creators group we looked at emulating the classic toy, the Spirograph.


The Spirograph consists of geared plastic discs. One disc is fixed in place over a sheet of paper and the other, with a pencil tracing the path, is allowed to spin around it. The result is a complex and beautiful design on the paper.

Screen Shot 2018-01-30 at 17.04.14

This diagram should help explain in conjunction with the photo. The centre of the black disc spins around the centre of the red disc, which itself doesn’t move. So the centre of the black disc rotates around in a circle. Pretty simple?

Now, the pencil itself rotates around the centre of the black disc. Shouldn’t that make a circle too? Well it would if the black disc wasn’t moving. Thankfully though, it is and that’s what makes this interesting.

Finding the Location of the “Pencil”

So how do we find the location of the pencil? Let’s look at our diagram again, but with things re-labeled a bit:

Screen Shot 2018-01-30 at 17.33.58

  • Centre: Formerly “centre of red disc”. It’s the fixed centre of our spirograph
  • Centre2: Formerly “centre of black disk”
  • Point: The point on our curve. This is where the pencil would be in a physical spirograph.
  • Radius0: Distance from Centre to Centre2
  • Radius1:Distance from Centre2 to Point
  • Angle0: The current angle of the line between Centre and Centre2
  • Speed0: The amount that angle0 increases every time we draw
  • Angle1: The current angle of the line between Centre2 and Point
  • Speed1: The amount that angle1 increases each time we draw

So at any time the location of our point is:

Point = Centre + [Centre2 relative to Centre] + [Point relative to Centre2]

So know where Centre is and if we can calculate where Centre2 is relative to Centre and similarly where Point is relative to Centre2, we can just add them all together!

Given an angle and a distance, can we get a location?

The answer to this is a resounding “yes”! Look at the diagram:

Screen Shot 2018-01-30 at 17.56.34

given an angle and a radius, we can calculate the X and Y position of any point around a circle. The magic is the COS and SIN (pronounced “kos” and “sign”) functions. These functions exist in almost all programming languages and JavaScript’s no exception.

Using p5.Vector

The last big concept we tackled thus week was using P5js’s built-in vector class to store (x, y) points and make our code tidier. To make a vector we just use createVector(x, y). We can then use functions to add them together, etc. We would get the same result working with the X and Y values separately but the code is a lot neater and shorter.

And in conclusion

This looks pretty cool:


Getting this week’s code

As aways, all the code from our Creator group can be found on our GitHub repository.


Explorers – Week 3 2018- Maths Game

Another great week, a lot of work was done in the Explorers room. Hope you all had fun making our Maths game!

CDA-S5-Challenge_10-Maths game-how to

A player picks a level of difficulty and the computer chooses 2 random numbers to add (subtract or multiply- whichever you choose!) together and show the numbers to the player. Fr this we needed 2 SPRITES and 4 VARIABLES called SCORE, LEVEL, NUMBER1 and NUMBER2 as well as 2 BACKDROPS. CDA-S5-Challenge_10-Maths game-ask questions1CDA-S5-Challenge_10-Maths game-ask questions

The player then has to enter an answer to the equation and the computer tells them whether they are wrong or right. CDA-S5-Challenge_10-Maths game-decisions alternative end

We repeated the ask/answer questions 5 or 10 times. Can you figure out where the REPEAT loop fits?

We also had a second sprite who reacted positively to correct answers BROADCAST and negatively to wrong answers BROADCAST. You can use whatever sprites you like and change their look whatever way you like. One coder added a puppy as their second and had him bark whenever an answer was correct. CDA-S5-Challenge_10-Maths game-sprite 2

After all the questions were asked we had the 1st Sprite SAY – Game Over! and BROADCAST Game over so that the backdrop changed and music played. There are two ways to change the backdrop- see below!CDA-S5-Challenge_10-Maths game-alt backdrop CDA-S5-Challenge_10-Maths game-backdropHere are this weeks notes in PDF CDA-S7-Week_3_18-MathsGame.pdf

Also I have uploaded the finished game to the www.Scratch.mit.edu website, just use the login details in the notes.

See you next week



Week 2, Explorers – Pen Commands

Hello Everyone,

A special welcome to all our new members that came to us this week, I hope you enjoyed yourself and hope to see you back again soon.

Thank you all for coming again this week. This week we looked at pen commands, we have not done this before in the Explorers group so it was new for everyone.


We also created some variables which we set as sliders which again is something we had not done before with this group.

And lastly we added buttons to our game. We added two separate buttons, a Start and Stop.











Here are the full Pdf version of my notes from this weeks session. CDA-S7-Challenge-Pen Command.pdf


Week 1 2018 Explorers – Breakout Game

Hi everyone,

Thanks to everyone who came yesterday and special welcome to our new people. Thank you all for your patience with the projector!

This week we did a game based on an old game called Breakout.

The object of the game is to try and get rid of all the blocks by bouncing a ball into them using a bat of some type. You all had your own versions of what you wanted the game to look that and that’s brilliant, your imagination is way better than mine.

The first thing we did was design your bat and write some code to control it. We decided that the mouse should control the movement and that the movement should be only from left to right and vice versa.

The rest of the code and notes for the game can be found here in PDF CDA-S7-Week_01_18-Breakout.pdf

I have also uploaded the finished game to the Scratch Website if anybody wants to take a look at it or for anyone that wasn’t there on Saturday. I will go through  it at the beginning of next weeks session if anyone has any questions.

You will find the login details for our account on the Scratch website in the notes above.


See you all next week and have a great week.



Explorers Week 9 – Paint Program

Hi everybody,

Hope you all enjoyed finishing up our drawing program. We made good use of costumes this week to make it look like we were dipping our paint brush in each of the different colours.

We also used a variable similarly to how we used in the Piano Game we made. We made it into a slider and then code select the Pen Size we wanted.

Here are the notes in PDF. CDA-S6-Week_08-Paint

See you next week for something a little Christmas themed!