Sunday, December 7, 2014

Minion Code Warriors

Lab based teach by example

Minion Lance and Minion Jocelyn learned coding for the first time in their lives today in preparation for Hour of Code on Monday.  We have already gone over a lot of the parts and pieces of the Arduino kits we bought a few months ago so all was left was to download the IDE and start working on their first project.

Helping debug code (low != LOW)


They first installed the Arduino IDE and set it up.  They set the correct COM port and selected the correct Arduino MEGA 2560.  They then hooked up their MEGA to their PC via USB.  This was all new to them and it was fun to watch their troubleshooting skills.  We had a brief talk again about electricity and how it was trying to get from a high potential to a low potential, kinda like water running down a mountain to get to sea level.  If you put a water wheel in the running water you could get the water to do work for you (see below picture).


A bit of theory

We worked though the picture schematic and they each wired up their breadboard.  I then printed off the code and had them type it in.  Lance was a quick one and said, "If you have it there you could just send it to us."  "No, I want you to type it in", I said.  They did and it was a great learning experience for them.  I was also able to help cook dinner a bit.  =)  After that they had to find all of their errors because their code would not verify.  Code has a very strict syntax, ledPin does not equal ledpin and they found this out.

What the heck is code anyway?

Once it compiled they uploaded it to their microcontroller and low and behold it worked!  Where they, and I, got really excited is when they started to change the code to try change how the LED turned off and on.  Tonight is the first time they have every coded, the first time they have ever even heard of a variable, or let alone seen what a loop does.  Their single LED blinked faster, slower, or stayed on all the time depending on how they changed the code.  I think the next session will be to remove ledPin and replace it with redPin, greenPin, and yellowPin.  I will explain how they can modify their current code to blink the other lights and help them understand variables, delays, and loops better.

All in all it was great.  I would highly suggest anyone interested in electronics to share their passion with their children.  I will leave you with a few more pictures of the Minions at work.

Battery tester extrodanar

Super excited Minion Lance (stealth mode)

Minion Jocelyn's 1st project
 
Dr. Ffreeze's blinky LED





Crazy Minion Zomie Monsters (in the dark no less)

I have nothing really to add...

Minion Grace as a Zombie

Minion Grace, Minion Dax, and Minion Logan as a Zombie