Huge thankyou to Google for supporting MadMaker!
Humans take sensory information as inputs, use our brain to process that information and output back to the environment using our muscles or vocal chords. Naturally occuring systems (senses, brains & muscles) have sythetic counterparts (sensors, MCUs/computers & motors/speakers).
When designing devices and robotics, we will often use a tiny computer like device known as a microcontroller (MCU) to control our product, as they can be very small, cheap and more specific for an application. Computers are typically power-hungry multi-taskers which is great for listening to music while playing games and browsing the web but for many real world engineering applications the cost, power and speed of a computer often isn't neccesary!
Left: The "surface mount device" (SMD) version is about the width of a fingernail!
Middle: The same MCU is offered in a larger version called dual inline package (DIP), good for prototyping circuits in a breadboard.
Right: Both MCUs are available in development boards. Arduino are a very popular series of development boards which contain various MCUs and pre-made circuits.
Microcontrollers are used all around us in everyday life to control things! Image source
By 2022 the MCU market size is predicted grow to over 3.5 million US dollars. Image source
The Esplora is an example of an Arduino development board. It comes with a MCU, some sensors (or inputs) and some outputs, already wired together so we can focus on programming it to do things. First we write instructions (code) in human readable language. Computer software like Arduino is used to compile our code, which means translate to machine-language the Esplora understands. More simply, we write instructions for the Esplora and send them from a computer to it using a USB cable. Once the Esplora has instructions or code sent to it, it will act out that code over and over until it loses power.
For inputs there's a joystick, four buttons, a light sensor, a slider, a microphone, a temperature sensor, and an accelerometer. For outputs there's a buzzer and a red/green/blue light emitting diode (or RGB LED. Check out the Esplora Library.
There is an addon screen which also provides an SD card slot. The screen is great for hand held video games and displaying sensor data / user interfaces. The SD card makes data logging a breeze - making it easy to log LOTS of sensor data, maybe classroom temperature of the course of a day, or accelerometer values from a bottle rocket flight.
The sliders are succeptible to breaking off. It is probably best to store the boards without the cable, maybe in a plastic food container. There is a 3D printable case on thingiverse that protects the slider well however it is quite time consuming and fiddly to print and assemble, It's not recommended unless you're a 3D printing hobbyist and have spare time. Link here. There is a work in progress MadMaker case, design here, or download the STL here. All the parts including the buttons print in place one go and uses three plastic screws to secure the Esplora board. Also worth noting is that the underneath of the Esplora has exposed electrical contacts, if you place the bare board on a metal desk it could short circuit.
Computer programs like above operate on a line-by-line basis, moving from the first line downwards and executing the instructions on each line as it goes. We call each line a statement, or sometimes an instruction. Statements MUST be ended with a semi column ; .
Writing code is all about manipulating data, therefore we need a mechanism for storing data, which we call variables, as the value stored can vary over time. To store data into a variable we need to initialise it. To initialise a variable we need to know what type of data we are storing. If we want to store an integer, which is a whole number with no decimal value, we have to specify int, short for integer, as that is the type of the value being stored. If we want to store a decimal, we could use the float type but we are just going to focus on the int type today.
To create the variables homer and marge as integers we use the int keyword. Accessing the variables by printing or assigning later, the int keyword is not needed. If a variable name is on the left hand side of the equal sign, it is being assigned the value on the right hand side of the equal sign. If a variable is on the right hand side of the equal sign that means it is being accessed to possibly be copied into another variable.
As we just saw, we can use maths operators on our variables. We can use the common mathematical operators on variables and numbers. Here is a table of the operators with examples.
Let's take a look at the control flow of the most simple program. It contains everything you need to compile and upload, even though there are no statements yet so it doesn't actually do anything.
Did I mention we have heaps of tutorial videos on our youtube channel?
For more info on control flow check out our video!
Comments are text that are ignored by the program, they are just there to make something clear to us humans, so we can remember what we were doing, or know what someone else was doing. They can be notes to yourself, or explain what the code does. You can see two different types of comments in the program above, but below is a description of each.
In programs, often we want to make decisions based on some input information. For example, if someone is trespassing, then set off the alarm. We can do this with an if statement. For example:
A conditional statement simply tests whether a statement is true or false. The condition we are checking is the thing inside the brackets. If the answer to the test is true, it will run the lines of code within the curly braces immediately after the statement. If the answer to the test is false, it will skip all the lines of code within the curly braces, and continue on later. Here is a list of conditional statements which are commonly used:
|Not Equal To||!=|
|Greater Than or Equal To||>=|
|Less Than or Equal To||<=|
The logical operators for AND (&&) and OR (||) are used to combine simple relational statements into more complex expressions.
Register as a teacher for the MadMaker Challenge and head to the IF Only secion
The MadMaker Challenge is a free and flexible online course. It is a STEM course with a focus on cutting edge technologies and programming. Solutions to all the problems are available if you are new to programming.
There is an official Challenge/competition period on October 8th for about 6 weeks. During this period we have online tutors that students and teachers can chat to 9-5. There is an optional project based competition in the final few weeks were kids can win prize packs for their school. If you are interested in trialling or partaking in the course, register for a teacher account here. Once you are registered and have clicked on the verification email, send me an email. I will verify you, giving you access to the "teacher dashboard" where you can make a class group, invite your students and then monitor progress in real time.
The MadMaker Coursework is linked to the new Digital Technologies Curriculum. This is detailed here.
This year we implemented automatically graded coding problems.
If you're interested in more info, we have a website here, a FAQ here and mailing list signup here.
For more introductory programming courses, The Australian Computing Acadamy (ACA) offer a range of free online, auto-graded STEM courses for K-12! You can view the courses here. The ACA also run the annual NCSS Challenge, which started July 30th. Finally, the ACA host the Grok Learning platform which offer even more STEM and programming courses at a small cost.
Zero Robotics is an international competition for years 9-12 high school students to write code that will control actual robots on the International Space Station! Sydney Uni offers help to schools looking to get involved. Applications have closed for 2018, but 2019 is already fast approaching! More info here!.
Click here for a full list of Sydney Uni STEM related offerings for high school students.
Here are some links courtesy of Google:
CS FIRST: free & open source
CS Unplugged: free & open source
Computational thinking recourses: from Google + partners
Start with Code: resources for parents, teachers & students
Code.org: Scratch and Hour of Code resources
MIT App Inventor: free introduction to programming and app creation
FIRST Australia: STEM & robotics programs from grade 2-12 - nationally run
Code Club Australia: code clubs & information/material to set one up
Code Club Aotearoa: code clubs & information/material to set one up (New Zealand)
Robogals: promoting STEM education to girls
Careers with Code: free online resource highlighting CS + X careers and university pathways
Digital Technologies MOOCs: from Adelaide University (free online courses, mapped to the
Australian Digital Technologies Curriculum for teachers from grades K-8.)
AU/NZ teachers: an online community of teachers who share resources
Engage CS EDU: resources for use in the classroom & best practices for inclusive teaching
developed by Google and NCWIT
Unbiasing: resources to raise unconscious bias in the workplace & for individuals. Includes Google’s internal training & free workshop material
Processingis an app which makes it really simple to write software like apps and games! But also it will help us visualise the Esploras sensor information to the screen. is similar in coding style to Arduino. However, the Arduino software uses code to program the Arduino boards and tell them how to function. Processing uses code to draw real time graphics like this:
It is recommended to download the Processing IDE to compile code but for now to save time we are going to run some sketches here in the browser using ProcessingJS. You definetely need the Processing IDE to get the Arduino Esplora to communicate with Processing which we cover in the MadMaker coursework. The control flow is very similar to Arduino except loop is replaced with draw. Both have the same looping functionality. Let's run some code!
You may want to jump straight to controlling processing apps using the Esplora, but I would urge you to go over the basics mentioned above until you feel confident, then go on to learn about arrays and for loops to be ready to understand the way Esplora and Processing communicate. However, if you're keen to see the communication between the Esplora and processing in action, upload the following code on the left to the Esplora and run the code on the right in Processing.
What you should see is a readout of alllll of the sensors of the Esplora in real time. This is quite interesting to see! Here is Dr Karl enjoying the code below in action!