Archive | Lessons RSS for this section

Making Joule Thief lanterns for a better world

My dear colleague Tracey Winey (you can find her on Twitter at @winey02  ) introduced me to the idea of philanthropic engineering – that students can make projects in class that can be useful in real-life for a good cause. Years ago, she and some other educator colleagues came up with the idea that kids could genuinely tackle light poverty – the lack of artificial light sources after darkness falls. In areas where electricity isn’t available or isn’t reliable, a nice light source can make a huge difference when it comes to studying, cooking, doing chores or staying safe. Our school and others around the world have already sent dozens of little lanterns to people in Guatemala, Honduras, Nicaragua, Uganda and other locations. You can find out more about the effort at http://e-b.io

This is normally an after-school program and my after-school hours are really limited with a busy family. This year I am getting my whole electronics class involved by having them create lanterns for Engineering Brightness. After some tweaking of the process this is where I am with it now.

  • I provide the electrical design and all of the parts, and the students pay a small class fee to cover costs.
  • Students solder the circuit together by following instructions I provide.
  • Students design some kind of case or enclosure for the lantern, by prototyping with cardboard and other household materials.
  • We will present and share the lanterns with their enclosures, and 3-D print a handful of the best designs.
  • As a class we’ll assemble the final projects and then put them in a box with some cards and photos. We will send them to either Liberia or Guatemala where Tracey has some contacts through her church.

I will share plans on how to make these if you’d like to have your class try it out as well. After we have a couple of enclosure designs, I can also share the 3-D models of those so you can print them and assemble the whole thing.

Before I get to the how-to’s, of course the big question here is what are we trying to teach the students? What do I hope they learn and how will I know they have learned it?

We’re working a little outside Colorado’s state science standards, but I don’t think every worthwhile learning experience has to be linked to standards. I also believe it’s OK if every kid’s learning is different. Here are some of the areas in which I want to see growth from the kids.

  • Understand that electrical circuits require a closed path, a load, and a voltage source, and identifying those in a real-life circuit.
  • Identify some basic electrical components, what they do and how they work.
  • After working with a design, identify ways it can be improved such as cost, size, durability and quality. Know what a tradeoff is and make smart tradeoffs when improving a design.
  • Consider a purpose of a product and improve it for that purpose.
  • Identify common electrical problems or mistakes and describe how to fix them.
  • Solder safely. Produce work that improves in quality over time.
  • Make something that will be meaningful to another person.

I based my little lantern design on a “Joule Thief”. Normally, a white LED takes around 3 volts to light up brightly – so you need two or three AA batteries for the purpose. Three are better than two, because once the batteries drain even a little bit, two won’t work well anymore. Rechargeable batteries are important because it is difficult to replace batteries in light-poor areas. The Joule Thief conserves cost and battery life by using a transistor and a ferrite toroid to make a single 1.2 volt rechargeable battery create a pulsing voltage that is enough to light an LED. It does this by making a magnetic field oscillate and it adds to the battery voltage. I go through some basic circuitry lessons with the kids, and we learn about LED’s and resistors, series and parallel circuits and what they do, and then we watch the joule thief video and compare/contrast it to a plain DC parallel circuit.

JOULE THIEF VIDEO

The students learn how to solder first by watching videos, and we take a soldering safety quiz before they are allowed to solder. Then students make their project bags and start assembling lanterns. I have had parent volunteers come in to help supervise the soldering and that has been a huge help.

I made this YouTube tutorial that shows you how to assemble the Joule Thief project. The students watch this video and pause it in spots to assemble their lanterns.

http://tinyurl.com/joulethiefvideo

 

In the video description, I’ve included a parts list and the instructions for making the circuit boards. I’ll also include it here. You just have to order some cheap electronics online, like wire, transistors, solar panels and ferrite toroids. The lanterns take one of everything, execpt LED’s. I used ten LED’s for each lantern. It’s all in this spreadsheet. You can make them for around $5 each if you shop around a little. I use eBay, Jameco and Amazon for my purchasing.
Parts List

The circuit boards are really fun to make. A couple of years ago, one of my former students came to visit me and showed me some custom circuit boards he created. He taught me how to design and upload my own… sometimes you’re the student, sometimes the teacher. The basic process is:

  • You lay out all of your components and the wiring using a program called Fritzing.
  • You export your Fritzing circuit to Gerber format. This gives you a bunch of files in a folder. If you want to use mine, you can download them here. GERBER FILES
  • You zip the folder using something like WinZip.
  • Go to Seeed studio at http://seeedstudio.com/
  • Select their Fusion PCB service.
  • Upload your zipped Gerber folder. You can use their Gerber Viewer to see the circuit board and make sure it looks OK.
  • Here’s the circuit board with the Gerber viewer.

  • Choose your options. I prefer a 2-layer board because the students get a solder pad on the top and bottom of the circuit board. My board’s measurements are 42.8mm*67.2mm and sometimes it doesn’t update correctly.
  • Decide how many you want. Place the order and it will be shipped to you!

 

Some of the first students finished soldering their circuits after about 3 classes, and they’re making little enclosures as well. I’m asking them to prototype enclosures using household items – and we’ll 3-D print the best ones. Here are some of the ideas so far.

 

I really love literal “light bulb moments” when the students finish soldering, flip the switch and the lights come on. It makes me proud every time I finish one, and I’ve done this a few times by now. It’s exciting for a first-timer.

We’ve watched some videos about Liberia and will be learning about Guatemala as well. I want the kids to start to get to know the people who will be receiving their little solar lights. Fingers crossed for a successful finish to the lanterns, and I really think if nothing else, they feel more competent and confident when it comes to working with circuits.

 

 

Advertisements

Learning Python with the micro:bit

This is such a big year for middle school computer science. I think that finally, for grades 6-8, there is a whole menu of really high quality teaching resources – from hardware tools to lessons and tutorials to standards to whole curricula. I’m pretty much changing how I do EVERYTHING, which is exhausting but exhilarating at the same time.

In the standards area, there is a new set of standards released by the Computer Science Teachers’ Association, or CSTA, located here. They are very good overall, building from grade level to grade level, organized by concept and very clear. I think it gives a nice progression for students. Many states, my own included, are involved in efforts to develop statewide standards, curricula and resources. It’s been great to see CS education move forward and the middle-years progression is really coming together.

As far as curricular resources, there are a few great new options. Code.org has a middle school course called CS Discoveries. I didn’t get to attend the training this summer, but one of my co-workers went and although she’s not a programmer by background, she came out feeling excited and confident that she could teach the curriculum and do a good job. It’s very well done so that pretty much anyone can take it and run with it.

The middle years are a great time to introduce kids to physical computing, the idea that you use algorithms and code to program devices in the world around us. It’s such an important tech literacy concept! The CS Discoveries course uses a platform called the Circuit Playground from Adafruit. For a long time, I’ve enjoyed the Sparkfun Inventor’s Kit and its little curriculum. I’ve also noticed a lot of buzz around the UK’s platform for introducing kids to physical computing – the BBC micro:bit. They are cheap and very engaging. I ordered a class pack of them, and from Sparkfun the price is really reasonable.

The BBC micro:bit Go bundle I purchased from Sparkfun.

I teach block-based programming to the sixth-graders and then work with the older middle schoolers on transitioning to text-based programming. For the younger kids, I was thrilled to find an entire CS curriculum for the micro:bit published by Microsoft. It is so good! I love its emphasis on “making” and creativity, and I enjoy the little unplugged activities. I was skeptical of them at first, but every time I try one of the unplugged activities I find the kids really enjoy it and it does help the concepts stick better. The curriculum is easy to follow, and I find the kids love finishing the lesson and then just playing with what they can do on the micro:bit.

I’m finding I can’t do some of the “invention” activities, because I only have one class set of micro:bits and they’re shared throughout the day. I can’t have kids mount the micro:bit in a pet or wearable, for example, because the next class needs them. That’s really a bummer – being a maker involves more than just code. I might try to do an invention project with the kids with the caveat that the enclosure has to let you insert and remove the micro:bit easily. We will see how things go this semester.

As you can see from the title of this post, one of the things I’m playing with is teaching text-based programming via Python to the seventh- and eighth- graders. I was not lucky enough to locate an entire curriculum for this, but there are some good resources out there. I am using the micro:bit python editor. You have to save your files locally instead of in the cloud, and actually this really beneficial. The students I have this year have had laptops in their classrooms since 2012, so they’re “digital natives”. But they’re so used to Google Docs and such that they sometimes don’t have a concept of what a file is or where it is actually stored. So we’re learning about local storage, networked storage, removable storage and cloud storage and figuring out how to access a file from different locations.

There are a lot of tutorials and a good reference at this site: micro:bit Python documentation. It gives a nice introduction to the different features of the micro:bit, but it doesn’t really teach Python. So I’m stitching together my own curriculum and put together these exercises.

In Lesson 1, we just wrote the normal Hello World program and the students were tasked with writing a program that displayed text and images, using some of what they found in the documentation. This task also involved uploading a program to the micro:bit and saving the file in local and networked storage.

# Add your Python code here. E.g.
from microbit import *

display.scroll('Hi!')

while True:
 display.show(Image.HAPPY)
 sleep(1000)
 display.show(Image.HEART)
 sleep(1000)

 

In Lesson 2, we reviewed Python syntax and common mistakes and troubleshooting. We introduced the terms “function” and “parameter” and saved some notes on these. We talked about the “while True:” loop and why the indentation is important. It’s not just picky – the indentation communicates important things to the computer! How will it know which steps to repeat without some way of blocking them off? Then we introduced variables by making a little program that displays text that changes. Students guessed at what it might do, and then we ran it and tested the hypotheses.

from microbit import *

name = 'Dawn'

while True:
 display.scroll(name)
 name = 'Tyrone'

 

Next in Lesson 3 we made a little counter program and demonstrated the difference between the string and text data types. Students could modify it by adjusting the starting value, displaying only evens, only odds, etc.

from microbit import *

# declare a variable and assign it to a value. 
counter = 0

while True:
 display.scroll(str(counter), 50)
 counter = counter + 1

By the end of this lesson, some students were feeling frustrated at how hard it was to load files, save files, upload to the micro:bit, figure out where the errors were and so on. But these are short programs and the debugging isn’t hard once you’re used to it. Students have to read the error on the micro:bit and it tells them which line the problem is on. They need to pay attention to little details and that can be exhausting, but it’s so important to give clear instructions to a machine. The machine can’t guess what you mean! We talked about how hard it was for them to write their names when they were children. If you think about it, it’s a long process! There can be dozens of little steps involved in writing your name and they were pretty bad at it when they first learned. But over time the steps became automatic and they got better, and now writing their name is a very simple task. Same with coding and debugging.

I could tell students were jonesing to make something that looked like a game. I decided to introduce random numbers as our next concept. So in Lesson 4 I had student volunteers pretend to be human variables, and we modeled what it would look like to write a program that multiplied random numbers together. First a random number is assigned to variable a. Then a random number is assigned to variable b. Then a and b report out what they are, and they are multiplied together and the result is stored in variable c. We report the result from variable c. Kids acted this part out.

Then we wrote the program together.

from microbit import *
import random

bob = random.randint(1,10)
jeffrey = random.randint(1,10)
display.scroll(str(bob))
display.scroll("*")
display.scroll(str(jeffrey))
display.scroll("=")
wilma = bob * jeffrey
display.scroll(str(wilma))

 

Many kids wanted to adapt their program to include a “forever” loop and keep producing random math problems as long as the power was switched on. By now they understood why the indentation worked, so when I suggested a “while True:” loop with everything indented after it, they were able to add it on their own.

 

Lastly, I wanted to introduce them to the coordinate plane on the pixel grid. For Lesson 5 I set out 25 pieces of paper in a 5×5 grid shape. I asked for one student to be a “pixel” and another to give directions. The student giving directions had to pick a random piece of paper, and in as few instructions as possible, tell the pixel where to go. We did this a few times and then I suggested that we make the paper in the top-left corner be (0,0). Then we realized we needed a sensible order for the row/column coordinates, so we defined “x” and “y”. We found out quickly that the pixels could only go from 0 to 4 and that 5 was off the grid. Lastly we introduced a “brightness” parameter, so when the instructor student commanded a pixel, they could tell the pixel student to go to an x coordinate, y coordinate, and to squat or stand according to a brightness level. So then we wrote this simple program and I reinforced the terms “function” and “parameter”.

from microbit import *
import random

while True:
 display.set_pixel(2, 3, 9)
 sleep(200)
 display.set_pixel(2, 3, 0)
 sleep(200)

 

And then we modified it to use variables instead of fixed numbers and the kids really liked the pixel dancing around on the grid.

from microbit import *
import random

while True:
 x = random.randint(0,4)
 y = random.randint(0,4)
 display.set_pixel(x,y,9)
 sleep(100)
 display.set_pixel(x,y,0)

Note I haven’t done much in the way of assessment other than conversations and verbal questions.. so we’ll have our first quiz task sometime next week to see how this is coming along. I don’t regret the direct instruction, though. The kids are finding it valuable, and they’re enjoying the micro:bits and learning what they can do with them.  They want to make games such as pong and snake, and I think once we understand how to use the buttons, radio and accelerometer, they’re going to have a really good time making things they haven’t yet envisioned. I’m learning right along with them. They ask me a ton of questions and my stock response is “I just haven’t learned that yet. I guess we will learn it together.”

It’s fun though. It keeps you young.

Some of the younger students enjoying coding.

 

 

 

 

Achievement Mapping in OneNote

So I’ve been thinking a lot about competency-based education – the idea that learners should be able to progress through a flexible map of skills or concepts or dispositions, tracking progress and reflecting as they go, with as much choice as is reasonable on the timing and nature of the learning, on a time scale that’s right for them. Simple… right? I’m playing with some ways of piloting the idea in my classroom and I keep thinking about gaming in this process. Most video games have levels or achievements, and gamifying education is based on the inherent motivation built into video games. Every time you fail a level, you get to try again. You try until you succeed. Success metrics are clear, and when you succeed you go on to the next level. I like playing Minecraft with my kids, and we have fun finding our way through the Minecraft achievement map. The skills are really clear-cut and the achievements have to be done in order.

Anyone who plays Minecraft recognizes this map.

Anyone who plays Minecraft recognizes this map.

I wonder if I can apply the gamification principles to a class I teach. I’m experimenting with OneNote Class Notebook to push an achievement map out to my students. I need the map to be flexible – I don’t have it all written right now, and I’m not sure a competency map should be articulated completely from beginning to end. Do you want your child’s educational path pre-mapped from K through 12 or do you want them to be able to take unexpected turns as needed? I’d like to be able to push achievement challenges to the students as they come up, and maybe assign achievements flexibly depending on student choice and need.

I can push the achievements out as documents that contain a checklist, maybe a place to paste some code, and a reflection from the student. I can respond to their achievements and use this as the basis for conferencing with them about their learning.

For example, as my first two achievements for kids:

achievement1

achievement2

This semester, I wouldn’t use the achievement map as a grade, but I could leave the door open for it as an assessment tool in the future. How far would a student need to progress through the map to “pass” the class and move on to the next one? This is something I hope to answer after this semester.

I really wish I could create a clickable map like the Minecraft one, where you could hover over a box and it would tell you about the achievement, or click on the box to submit an entry to pass the achievement. When you passed one, the following achievements would be enabled. I know this is doable, but time and 217 students and so many preps and…. it’ll have to wait for a break, unless someone has created a tool like this and I just don’t know about it. Any badging or achievement-mapping tools out there that I should learn about?

What do you think? Have you ever gamified a graded class? What structures did you use and what should I fix before diving into this?

Etching your own PCB’s in a classroom

A couple of years ago, one of my former students came to visit. He brought business cards and a selection of little printed circuit-boards, or PCB’s. My questioning turned into a lesson in which a 15-year-old kid taught me how to install some circuit-designing software, create my own circuit board, export the design and e-mail it to a factory in China where the boards would be manufactured and mailed to me. It was one of the most empowering things I’ve ever learned! I feel I got some valuable consulting work from this student, and he provided it for free. What a generous gift and a valuable example of a teacher and student learning together.

A former student taught me how to make this!

A former student taught me how to make this!

I found out since that time that you can actually etch your own printed circuit boards at home, for quick prototyping. In electronics class, my co-worker Tracey and I created an engineering project for the students: design or modify a small, rechargeable LED-based lantern that works. This semester, I thought I would offer the opportunity for students to learn to etch their own PCB’s if they wanted to do it for their design. This was a rich and challenging project, and I want to share how we did this with middle school kids – with some notes of caution. It’s hard to do in a big group. I was grateful to have Tracey’s presence to work with most of the class on an alternate lesson while I took small groups to work on PCB design and etching. It was failure-prone and high-frustration, but also high-reward. Here’s how we did it.

First, the students need to design their circuit and generate a high quality, printable image of the copper traces. I used Fritzing, a free program that is fairly easy to use. I taught the students how to lay out a simple parallel circuit with resistors and LED’s. The components can be either surface mount (SMD) or through-hole (THT), but you want to choose Through-hole. Pay attention to the pin spacing to make sure it matches the components you have. In our case, we needed 3 mm spacing for the LED’s and 400 mils (these are thousandths of an inch, not the same as mm) for the resistors. I don’t know why the default units were different. I added a couple of via’s to connect to the switch and battery. Choose the “home-etched” setting for via’s to make them a little bigger.

Completed simple PCB in Fritzing.

Completed simple PCB in Fritzing. Most students added 5 or 6 resistor/LED pairs.

Students could add as many resistor/LED pairs as they wanted, and rearrange them as needed. Some students created some interesting layouts for their PCB.

Next, we had to export the file to a high quality PDF. In Fritzing, choose File –> Export –> As Image –> PDF.

I stitched together a couple of methods from online articles for the etching part. This article from Hackaday used the magazine page transfer method, and it worked all right with some cautions.

Here are the supplies you need for this step..

  • Glossy magazine paper and a laser printer. We found the alumni magazine from my university works well! Its 8 1/2 by 11 size and nice sturdy paper loaded and printed in the laser printer perfectly. We had some success with catalogs pulled from my mailbox too, although the paper was thinner so it tended to jam.
  • One-sided copper clad PCB. You can get lots of this very cheap on eBay.
  • An iron and ironing board (we borrowed these from the family consumer science teacher)
  • A scotch-brite scrubbing pad.

You need to load the glossy paper into your laser printer and print the PDF of the copper traces. Fritzing will export a lot of files into a folder – print the one that ends in “copper_top_mirror”. You might have to try a few times before you get a nice printout on the magazine paper.

Buff the copper-clad PCB with the scotch-brite pad, until it’s roughed up a little.

Turn the iron to its hottest setting, and make sure there’s no water in the iron. Put the magazine paper with the image on it face-down onto the copper clad. Push down HARD with the iron for a full two minutes. Then move the iron around still pressing down hard, for 4 more minutes. This process sometimes took 4 tries to get a good transfer and was really difficult with a number of groups to work with. Imagine it takes pressure on every wire trace in order to transfer it from the paper to the board, and visualize how you have to press the iron down to make this happen.

Ironing. For the first time ever.

Ironing. For the first time ever.

Inspect the copper clad to make sure the image transferred with no thin or broken spots. We attempted to fix a couple of the designs with Sharpie, but it really didn’t work well. Better to transfer properly the first time.

A bad transfer, and a better one.

A bad transfer, and a better one.

Now you’re ready for the etching. For this part, I used the second half of the instructions from Blondihack. Some blogs recommend using muriatic acid, but with middle-schoolers the normal kitchen chemicals are the way to go here. You will not regret using plain old vinegar. You really should use a proper science lab with fume hoods, sinks and safety equipment. At the very least, make sure you have safety goggles and nitrile gloves for everyone, and access to a sink. To do the etching, you need:

  • White vinegar
  • Household hydrogen peroxide
  • Some salt
  • Foam brushes
  • Plastic tubs
  • Measuring cups and spoons
  • Safety goggles and gloves
  • A timer
  • Acetone (nail polish remover)

It’s pretty simple. Pour equal portions of hydrogen peroxide and vinegar into a shallow plastic tub. Add about a teaspoon of salt and stir it gently. When the salt is dissolved, put the PCB into the solution. You’ll see a film of yellowish gunk appear on the board, and over time the liquid will turn blue. About once a minute, use the foam brush to wipe the gunk off. It took us about 50 minutes to complete the etching. When you’re close to done, the edges of your board will be free of copper. You’ll know you’re done when all of the copper is dissolved except for what’s under the black toner. When you’re at this point, rinse the board with lots of water. We washed the remaining etching solution down the drain with lots and lots of fresh water.

This is boring work, but the kids don't mind socializing while they wipe the boards down once a minute.

This is boring work, but the kids don’t mind socializing while they wipe the boards down once a minute.

When you're close to done, you can see the edges of the board are free of copper.

When you’re close to done, you can see the edges of the board are free of copper.

Done, rinsed and ready for the next step.

Done, rinsed and ready for the next step.

When the board was rinsed, we took paper towels and some nail polish remover (acetone) and scrubbed the rest of the toner off the board until the copper was visible.

After scrubbing with acetone. Ready for drilling!

After scrubbing with acetone. Ready for drilling!

I used Blondihack’s method for drilling holes with a Dremel tool. I did the drilling and chose not to let students use the Dremel. It has the potential to really hurt you and this step requires a steady hand. Get your inner brain surgeon ready.

For the drilling, you’ll need:

I recommend clamping your PCB to the table on top of scrap wood. You really want to make sure it doesn’t move around. Wear the safety goggles. Use the 1/32 inch drill bit and carefully drill a hole in each location on the PCB.

Next the students can solder the components onto the PCB. You can only solder them onto the copper trace, not onto the blank side of the board. Clip on the battery and test it out! Students sometimes had to use solder or jumper wires to fix locations where the copper traces were broken or thin. They cut the boards down to size with tin snips (fairly cheap at Home Depot) and sanded them when needed.

Soldered and cut! They look great.

Soldered and cut! They look great.

The groups that had fewer problems were able to finish their circuit boards in 3 class periods, but some student groups took up to 6 class periods. These groups had to re-do steps along the way, usually in the printing and transferring, but sometimes in the soldering as well.

It was a supremely rewarding process. The students were so proud of their work. We all learned a lot about how printed circuit boards are made, and I think the kids felt as empowered as I did when I made my first PCB with that student so long ago. Students stayed after class and after school, trying over and over to get the process right. They really wanted to finish it once they started.

Showing off their work with pride!

Showing off their work with pride!

I would strongly recommend having extra adult supervision if you try this activity with kids. Six students at a time seemed to be my capacity – consider bringing in parent volunteers or community members and training them on what to do. Plan ahead for science lab space, drilling and soldering, and for how you’re going to manage failures, because they will happen. It’s part of engineering.

If you try PCB etching with your engineering students, I’d love to hear from you. What went well? What would you do differently? What did I miss that I could be doing better?

Thanks a bunch to Quinn Dunki and Jason Rollette for their tutorials.

Reflecting on Reflecting

In my 6th grade tech class, called Web 2.0, my colleagues convinced me to include some keyboarding practice in the curriculum. It’s not a fun topic to teach, but it is a really important life skill and it’s not taught in any of the kids’ other core classes. One of my fellow tech teachers had a great idea to have students keep a spreadsheet of their keyboarding speeds throughout the quarter. The students take a 1-minute test every day and log their score in the spreadsheet. We use the sheet to teach students about using formulas, and it’s a good daily reflection tool on their growth.

We use NitroType and typing.com as tools for practice. NitroType is really engaging and I really like the drills on typing.com.

I have the students calculate their average speed (the average formula), their growth (using max, min, and subtraction), and how many times they got 25 words per minute or more (using the “countif” formula). A finished spreadsheet looks like this.

typing_speeds

Here’s what I find fascinating. I think teaching keyboarding is really boring. The online tools make it bearable. I put on my game face and practice with the students, and challenge them to race me to keep myself engaged in it. The students, however, LOVE it, and I think what they like about it is that they track their progress with a number. They know when they’ve improved. The goal is crystal clear and they can tell instantly if they’ve met it.

At the end of the quarter, I asked the students to reflect on whether they met either the goal I set for them (which was to gain 10WPM and be over 25WPM at least once), and whether they felt they had met their personal goal. These were some of their comments.

“I Met my score :)”

“I love TYPING”

“My goal was to increase by 10 words per minute. I started at 27 words per minute and slowly increased and got better until I got to 39 words per minute which was past my goal”

“My goal was to get to 35 WPM and I passed it by 10, I am really happy.”

“My goal was to get more accurate and more comfortable without looking at the keys. This I think I did improve on.”

“I improved so much!!!!!!!!”

“I think I’ve really improved with my keyboarding. I think I met my goal because I beat 25 by at least 20 and all of my scores were in the green. I will continue to practice keyboarding as I believe it will help me in the future. The time we had in class helped my improve and I fell like I’m 10 times faster than I was last year. Even if that is an exaggeration I really mean it when I say I got a lot better, so thank you for making me not only a better typer, but a better student as well.”

“I got to 25! That was very exiting because I am not that fast at typing! and I made my spread sheet very colorful!”

“I am proud of where I am with my typing and gained ten WPM”

 

Isn’t it interesting how motivating it is to have a clear goal and know immediately if you’ve met it or are improving? I see this every quarter. I wish I had a way to give students this instant satisfaction in classes in which progress is slower and proceeds over the course of a project. Learning coding can feel like this if you do activities like an Hour of Code, but what about learning in a creative problem-solving setting, where you have to investigate, discover, create, try and fail, iterate, gather data and perfect an actual product? Can I help students reflect on their day-to-day growth and their short-term goal setting as a motivational tool? I’m sure I can facilitate this by putting some good reflection tools in place. Let’s make this a New Year’s Resolution – I will help my students become motivated and reflective learners, and to track their own progress to make them feel the same sense of satisfaction my keyboarding students get.

A Week of Minecraft Camp

I have not blogged in a very long time! A lot has happened in this exciting semester, including being honored as an Allen Distinguished Educator and getting to work with a phenomenal team to create resources to share with the public. I will write about that experience as well, but am moving in reverse-chronological order, starting with the most recent project. I teach classes at our district STEM institute every summer (find the website here: http://www.steminstitutes.org/) . I love teaching at the institute. I wish school could feel like this all year long. This year, I had the pleasure of teaching a Minecraft Explorations class during the morning and afternoon. It hit me about a week before the institute that I was getting paid to play Minecraft all day long – living the dream!!

At the beginning of this school year, I purchased licenses for MinecraftEDU and I love it. Unfortunately, as you can tell if you follow the link above, the old MinecraftEDU is now in transition. Microsoft is re-writing and re-releasing the educational version as Minecraft: Education Edition. I would love to use it, but it’s only going to be available on Windows 10 and my district’s IT department has been very clear that we are not moving to Windows 10 this year. I had JUST convinced a whole bunch of colleagues to purchase MinecraftEDU, and a couple of them had JUST gotten the funding approved, when we found out we could no longer purchase MinecraftEDU – and the new Minecraft: Education Edition is not an option for  us at all because of our operating systems. It is extremely frustrating – I believe in this tool and think our kids will really benefit from using it in classrooms, and our progress as a district has been completely shut down.

I am still able to use the old MinecraftEDU, and I did. The kids loved it and I had a wonderful week. I decided early that the kids could make a creative map and design anything they wanted, on a safe school server – and that I would provide mini-lessons every day to add a little more to their Minecraft toolkits so they could build even better things at home. I provided them with flash drives that had all of the mods, maps and documents they would need.

Day 1: Beginning build and Redstone lesson.

After some getting-to-know you activities, I told students they could sit next to one or two people they would like to build with. We first installed mods on the computers: I installed Mr. Crayfish’s furniture mod, BiblioCraft, Custom NPC’s, ComputerCraftEDU, Malisis Doors, Carpenter’s Blocks, and the Key and Code Lock mod. I opened a creative server and had everyone spread out with groups far away from each other. I told them they could build a home and to pick a theme – a castle, a dungeon, a zoo, a specific animal, a treehouse – anything they wanted. The kids loved the mods and were thrilled with the furniture mod, which allowed them to have Minecraft blenders, refrigerators and sinks among other things. The Carpenter’s Blocks are really cool – they allow you to create angled, curved and sloping blocks with any texture you want.  And the Malisis Doors mod allows you to create interesting doors and even custom doors with special animations, textures and combination locks. Fun!

We then saved and temporarily shut down the creative world, and I opened a redstone world map that I made. It’s located here:

http://services.minecraftedu.com/worlds/node/210

This map takes students on a tour of redstone contraptions. I spent some time over the weekend watching video tutorials on more advanced uses of redstone. Did you know you can make logic gates with redstone? You can create a NOT gate, OR gate and of course an AND gate. I wouldn’t be surprised if someone, somewhere, has made a fully-working computer or arithmetic-logic unit using redstone.

In the map, students explore different redstone devices and activators, and also learn about logic gates, repeaters and comparators. I finished the map with a Kahoot! quiz and then opened the creative world again. Students were instructed to add their own redstone contraption to their home. Some of them were very complicated – I would never figure out how they worked!

Day 2: Custom NPC’s

Non-playable characters let you turn a map into an adventure or a quest. These characters can be configured to follow you, fight for you, trade with you and have dialogs. I gave a mini-lesson on how to create an NPC using a special wand, and then how to set up a dialog with multiple-choice answers. We also learned how to add quests to the NPC’s dialog. The non-playable character can be part of a storyline, leading you from adventure to adventure. I suggested that the next time students have a science project, a book report, or a time in history to write about, they could do the project as a Minecraft adventure! Wouldn’t that be a more fun way to learn about the Revolutionary War if you could interact with the main players and let them tell you about the events?

The lessons are summarized in these videos.

NPC dialogs and command blocks:

This video shows how to use quests:

http://screencast-o-matic.com/watch/cD1iehiIo5

To finish out the day, I gave the students command blocks using the command: /give @a command_block

I gave kids a very basic tutorial on using command blocks. You can set up the blocks with a command, and activate it with a lever, button, or other redstone connection. Some simple commands include:

Summon an entity: other entity names can be found online

/summon Zombie

Give the nearest player an item

/give @p cookie

Teleport the nearest player to the following x,y,z coordinates.

/tp @p 100 75 -200

I would not recommend giving command blocks to a large class and you really need to be cautious with them. They give great power! There is a connection with computer science here… each command is like a function, and the parameters follow the function name. Just as with any computer language, punctuation, spelling and capitalization are important.

We played a Kahoot quiz on custom NPC’s to finish out the day.

Custom NPC Kahoot

Day 3: ComputerCraftEDU

On this day, we introduced turtles! These are adorable Minecraft robots that you can program to mine, dig, chop, attack and build for you. The ComputerCraftEDU turtles use a graphical programming language that is fairly intuitive to learn, and maybe more importantly, super cute. I introduce the turtle coding with a little “hour of code” activity I developed for them.

Turtle Hour of Code

The language looks like this. This program tells a turtle to dig, move forward, dig – then place a block, move backward, place another block.

turtle_program_example

The language has variables, loops and conditionals as well. We talked about how important it is to specify WHICH steps you want to repeat over and over again. I often introduce loops by having students write instructions for a “human” robot to do something such as walk down a line of kids and tap every kid on the head. The instructions might say something like this:

Start at the first kid
Tap on head
Go to the next kid
Repeat until no more kids

If I follow instructions like that, I may tap only the first kid on the head and then just walk to every other kid until I get to the end of the line. Or, I might repeat all of the instructions – start at the first kid. Tap on head. Go to the next kid. Start at the first kid. Tap on head. Go to the next kid. Our language needs a way to specify a beginning and end of what exactly is repeated.

The Turtle coding language has this. For a repeat loop, for example, the instructions to be repeated are bookended by “Do” and “End”.

turtle_program_example2

The “Place” and “Move Backward” instructions are inside the Do and End blocks, so the turtle will place a block and then move backwards, and repeat those 2 instructions 8 times.

After we do some whole-class activities experimenting with the Turtles, the whole class discusses how you would write a useful program that the turtle could run that would help you in Minecraft. We talk about some activities you do in Minecraft that might be helpful to have a robot do for you: exploring at night, fighting some of those nighttime mobs, mining, chopping down trees, building a house, farming. We choose one of those examples – say “mining” and discuss what exactly you’re doing, step by step, when you mine. The kids usually start by describing how they dig a staircase into the ground. But we have to talk about special conditionals that pop up. What if you dig into gravel? What if you dig and find lava, or a cave? If you find iron,  should you keep digging forward or do you dig in all directions to see if you’ve hit an iron vein? Once you’ve dug down a certain depth, how do you return back to the surface? Writing all of this down as a program becomes a challenging and interesting task.

I gave the kids a couple of example programs that do some complicated mining and tree-felling, and let the kids explore the pros and cons of them and try to make the programs better.

Mining and Tree-Felling Programs

 

Of course,there is a ComputerCraftEDU Kahoot Quiz to finish things out. 🙂

ComputerCraftEDU Kahoot!

 

Day 4: Modding

Kids were very interested in modding, but this is the most difficult concept to teach. What is a mod? Think of Minecraft as a box of plain legos. The analogy to a Minecraft mod is a specialized set of Legos… the Harry Potter kit, the pirate kit, the farm kit. A mod uses Java code to connect to Minecraft’s events and data structures, letting you create customized blocks and items and even mobs. Most kids have an idea for a mod they’d like to create. Most kids will not get there on their first mod, but they’re excited to start down that road.

I have an O’Reilly book about modding that uses Forge and Eclipse, and I was fairly successful at home at writing a simple mod and getting it to build. I ran into troubles when I tried using this on the school computers – installing the software, keeping the folders straight, and working around blocked websites was very painful. Then one of my students introduced me to MCreator. This is a very nice tool found here:

https://mcreator.pylo.co/

MCreator uses forms and menus to generate the Java code for mods. First we used the “Tools” menu to access the texture drawing tools, and kids drew their own texture for a block or item. Next we went to the Workspace and created a new block. The menus let you choose the block’s texture, its properties such as hardness and luminescence, and the events it responds to – what happens when you place it, right-click it, destroy it. The tool creates the code, and then you can click “Export” to create a .jar file, drop it in your mods folder and voila! The only catch to running this on a school computer was that the kids have some websites blocked (including minecraft.net) that make it so they can’t actually build the mods from school. I had the students give me their MCreator folders on a flash drive, and I built the mods and gave the flash drives back with the .jar file on it. They had a lot of fun seeing their mods come to life in a singleplayer world.

Day 5: Putting it all together

On this day,  we made our houses presentation-ready and put together a poster board for the parents. We played some charades and made sure the map, mods and MCreator files were all on the students’ flash drives. For files created in MinecraftEDU, they could use the maps and mods at home if they used the right version of Forge. The version I found that worked is 10.13.2.1291. I gave kids instructions for copying the mods and the map for use at home:

Home instructions for Minecraft

We played survival, just for fun, for the last hour of class. Great fun and excitement to hunt, gather, and dodge zombies together for a while.

I feel when you’re teaching just a weeklong class, you have a tradeoff to make. I chose to focus on new tools and skills in the Minecraft world rather than creating a big project – we worked on a creative house build but the class was really composed of four mini-lessons and not one large product. I also think there’s a lot of value in having the students plan, execute and troubleshoot through a whole-class build with a theme. With the custom NPC’s, I’d love sometime to create a multi-player adventure map with quests and an educational purpose. Maybe that will be my focus of my Minecraft enrichment class next year!

 

Arrays in Middle School #csk8

How do you give instructions to pull a random book off a shelf? Or to sort all of your books in alphabetical order? Or to remove the books off your shelf that were written before 1960 and order the rest by date? Or figure out the average length or Lexile level of all the books you have on the shelf?
If you have ever considered problems like these, a computer program can help you and you need to use data structures.

In Computer Science, since I started the semester right away with coding AND I have a very sharp class this semester, we have actually gotten to data structures – the kids are learning about arrays. I mostly learned about arrays in college, so teaching it to middle schoolers is still something I’m new at. I am spreading the instruction out over about a week and a half.

I started by addressing the need for arrays, by having the kids modify a little fortune-teller. The starter code is here.

Fortune Teller Starter

The fortune teller uses three variables to store different fortunes, and then picks a random number. Then it uses a series of if/else statements to choose which fortune is displayed. Pretty simple. I asked the kids to add a new fortune to it and tell me in how many places they had to change the code. The kids did, and the consensus was that it needed three changes: add a new variable, modify the random number generator, and add one more else/if clause.

So then I led them through a short explanations of arrays. You have one variable and it contains an indexed list of data instead of just one data item. The first item is always item 0, then item 1 and so on. This indexed list is called an array. It’s like the arrays they worked with in math class to multiply. You can make arrays that are two-dimensional or more, but this one is just one-dimensional for the list of fortunes.

We modify the program so it looks like this.

Array Fortune Teller

I asked the kids if they would prefer me to go over the instructions live or let them watch a video. Almost the whole class preferred live instruction, which surprised me. I made this nice instructional video but then didn’t use it.

Instructional video: Using an array in the fortune teller

With the new code, adding a new item to the list of fortunes requires only one change to one line of code. Much simpler to make changes! But a little trickier to code.

In the next lesson, we look at how to use a loop with an array to do something simple, like print the contents of an array to the screen. This is also a mainly teacher-led demo, but I did make a nice instructional video that again I didn’t use.

I start with this code:

Print an Array Starter

And then I had this video, which we didn’t use:

Video for looping to print an array

I feel that when you start getting into data structures, that’s where interesting algorithmic work with computers really starts. I decided to have the kids do a little algorithmic role-play to see how they would make a computer work with an array.

I lined up a row of kids at the front of the board and told them to all write down a number on a card, but keep the number hidden.

An array of data, starting from index 0. Can you write instructions for a robot to find the largest number?

An array of data, starting from index 0. Can you write instructions for a robot to find the largest number?

Then I asked the rest of the class to write a set of instructions that a robot could use to figure out the biggest number on a student’s card.  The kids asked “can’t you just write an instruction to have everyone flip their number over and see which one is the biggest?” I said no, robots really need things written step by step, so start with which kid I should walk to first, and what I should ask them and so on.

I knew I’d have some kids that would absolutely fly with it, and I also knew I’d have some that would have trouble with this concept. I did. However in the discussion, a basic understanding of the algorithm came out:

  1. Look at the first number.

2. Remember it.

3. Look at the next number.

4. Compare this number to the one you remember. If it’s bigger, then throw away the number you are currently remembering and remember this one instead.

5. Repeat steps 3 and 4 until you run out of numbers. The number you’re remembering is the biggest.

Arrays are hard, in which the array itself has a variable name, and then the index in the array can be referenced by another variable.

int p = 2;

This use of a variable is pretty straightforward and only takes a little practice to understand. Kids have been using variables since 5th grade in math class, so they have some background with it.

int [] p = {9, 72, 40, 12, 35, 99, 33};

This is more difficult as the whole array is named “p” and your algorithms require that you reference each number with “p” and its index. But so powerful. You can manage really complicated math once you have a basic understanding of data structures.

Anyway. We coded the “find the biggest number” problem by using a sample program, below.

 

int [] nums = {12, 59, 2, 63, 400, 88};
void setup() 
{
  int num_i_remember; 
  num_i_remember = nums[0];
  for(int i = 0; i < nums.length; i++) 
  { 
    if(nums[i] > num_i_remember) 
    { 
      num_i_remember = nums[i]; 
    } 
  } 
  println("the largest value is " + num_i_remember); 
}

 

The challenge I gave to the kids was to write a teacher tool. Sometimes, teachers have to do creative things with their data. For example, I gave 11 quizzes during a semester. Students convinced me to drop the lowest score and average the other 10.

The pair programming task: given an array of 11 quiz scores, find the lowest score, drop it and average the other 10, then tell me the average.

The kids did a really awesome job and only a couple of pairs got stuck and needed a lot of support. The most common solution was the one like Anoushka’s, below. She modified the code that found the largest number so it found the smallest instead. Then she averaged the rest of the numbers using brute force, but with only 10 numbers it worked just fine.

Anoushka’s Teacher Tool

Some students were able to get how to iterate through the array to find the total, subtract the lowest score, and divide by how many numbers there were. Maya’s solution works no matter how many quizzes I give during the semester.

Maya’s Teacher Tool

 

What’s next? I think we will do some unplugged activities to refresh / review, and then make a project that brings arrays to life by storing information useful to teenagers – like the locations of sprites in a video game! I think we’ll work on an animation with a bunch of images that have x and y coordinates stored in an array. Maybe we’ll think of different structures for the data (one array storing both x and y coordinates? 2 arrays? Dare I introduce multi-dimensional arrays?). Then after that… a mini-project, a little game or interactive animation including all of the things we’ve done so far. Processing is so colorful and interesting, I want to see what the kids can make with it.

 

 


					

Review/Extension Activities for Looping and Conditionals

More than once I’ve finished or half-finished a lesson knowing that some kids understood most of it, some really didn’t get it at all and I didn’t get enough information during class to really understand where I should go with things the next day. If you back up and review, you bore the kids who understood already and run the risk of teaching the same ineffective way you did the previous day. If you plow ahead, you will really lose the students who were barely understanding the day before.

In this situation, I sometimes do a code-analysis card sort.  I write a handful of code snippets and produce output from them. Mix up the code and outputs, partner up the students and ask them to match code to output. It takes less than 10 minutes, and then you have a whole-class discussion where you ask groups to report out. What’s a match you feel confident about and why?  What is a match that gave you trouble and why?

Here are a couple of my card-sorts from this year’s CS Exploration course, in which I have been teaching Processing.

Function Match:

example card from the function card sort.

example card from the function card sort.

In this card sort, there are four function definitions, four function calls, and four descriptions.  The students’ job is to match a definition to a call to a description. Before making copies, I put a letter (A,B,C,or D) on each function defintion, a number (1234) on each call, and a symbol on each description.

https://docs.google.com/document/d/1sEnnMD7T4i_AxqfIyosZ2VCBZOkbtU7yx79fNbBqGNI/edit

The card sort is really simple because each function has a different number of parameters. If a student can recognize that the definition with three parameters matches the call with three parameters, they can do the sort. But it creates good discussion when you talk about why the matches work, what the parameters mean, and how we know the descriptions match the definition and call.

I also created a Function Kahoot! quiz to do before or after.

https://play.kahoot.it/#/k/0aa8f906-3de9-41be-8b9f-ce5b9ced5e97

 

Next I have a card sort on looping. It only focuses on While loops. The task is to match the code with the output.

loop1\

The cards are here:

https://docs.google.com/document/d/1f-OGnz_jCIv_Zh2iNDY0XpTQbK1VjUYTLr9gzh7PHn0/edit

Again before I make copies, I label the code with letters and the outputs with numbers to make it easy to report out what matches the students made.

The discussion on this sort usually hits on two ideas. Is the x-coordinate or y-coordinate changing, and how do you know? How do you know how many times the loop will run? Good tie in with some linear algebra here – the starting value has some connection to y-intercept and the increment each time has a connection to slope or rate if you choose to go there. There is one card that will freeze the program because it gets stuck in an infinite loop, and it’s an important one to discuss as I always have students that take some time to understand the idea of the infinite loop.

 

I also have a Kahoot! quiz on variables and expressions, without loops/conditionals or anything like that. Might be a good review activity.

https://play.kahoot.it/#/k/3ef963cc-0ceb-4c83-9616-fa7c714698f1

I’m working on adapting some of my older Kahoot! quizzes from the Khan Academy Processing JS to the stand-alone Processing, but here they are if you are interested in the Khan version.

Khan Kahoot! on conditionals and booleans:

https://play.kahoot.it/#/k/62584d63-7484-4490-bb23-019c8ee1a7e0

 

I had this one to quiz students on the draw() loop and how it affects variables. I don’t think I’ll adapt it for Processing but it might be useful to someone.

https://play.kahoot.it/#/k/10a75250-560d-4550-a202-b936149173dd

 

 

What are some of your ideas for differentiation, discussion, extension and review?

 

Teaching event-based programming – a traffic light

Recently as I was looking through my blogroll, I read Mark Guzdial’s review of the K12CS.org Framework. I wished I had been able to review the framework with a group – I didn’t feel that I generated great ideas about it on my own, but I did like reading Mark’s. Reading my social media feed sometimes impacts what I’m going to teach. In this case, Mark made a point about models of computing:

Great research by people like John Pane at CMU has shown that novices think of programs as responding to events, being reactive (e.g., think apps, games, GUI interfaces). Thinking of computing as input-processing-output is an older model, difficult to understand, and less common today.

 

Huh. I had been teaching programming as input –> do stuff –> output and wondering to myself what to do when this model broke down. I never really thought about how I teach event-based programming differently. I decided I would give it a try, though. In my 7th-8th grade CS class, my kids had learned about variables, conditionals, and functions. Normally I would plow right into iteration but I decided to take a detour and do some activities with the kids on event-based programming. We did a couple of examples working in Processing with draw() and mouseClicked() and keyPressed(). I decided to introduce an activity involving a state machine to teach the difference between linear programming and event-based programming.

I talked with the kids about how many of us think a traffic light works. We see it as a linear set of steps.

trafficlight_maya

trafficlight1

But in reality, we know the traffic light has a set of sensors. And when a sensor is tripped and other conditions are met, then the traffic light advances to the next state. You can model the state with a variable. In this case, I used “lc” for light color. We can model the sensors with button clicks and key presses.

trafficlight2

We wrote this program together, imagining that the mouse click simulates a timer expiring, and the space bar simulates the sensor that detects your car. I did this as a teacher-led launch. Kids followed along and ran their programs. Easy.

http://www.openprocessing.org/sketch/311664

 

The kids asked about how you simulate a real timer. In Processing, there isn’t an easy implementation of a “delay” function, so you have to poll for a timer. There is a built-in function millis() that returns the number of milliseconds since the program had started. The kids played with the millis() function and had fun writing the time to the screen. So for the next class, I decided a program that used timers would be a good extension and problem-solving activity.

In the second class, we looked at this state machine model.

trafficlight3

My amateurish drawing shows looping arrows where you are polling the timer. As long as the “ready” variable, for example, is 0, then the light stays the same. As soon as the “ready” variable changes to 1, then you can advance to the next state. You can check for “ready” by doing some math on variables that store the value of millis(). One variable stores millis() over and over again. Another variable only stores millis() when the state has just changed.

I put the kids with a partner and made this a pair programming assignment.  We reviewed the norms of pair programming. I gave them a starter program that just showed a red screen and used the millis() function to display the elapsed time. I had some variables in the program but did not tell the kids how to use them. Their task was: turn the program into a timed traffic light. It should turn the red light on for a certain time, then the green light for a longer time, then the yellow light for a very short time, and then go back to red.

This is the starter program.

// 0 is red, 1 is yellow, 2 is green 
int lc = 0; 
int ready = 0; 
int oldms; 
int newms; 
int elapsedms; 
int interval; 

void setup() 
{   
  size(400,400); 
  ready = 0; 
  oldms = millis();
  newms = millis(); 
  elapsedms = newms - oldms; 
  interval = 5000; 
}
void draw() 
{
  if(lc == 0) 
  { 
    background(255,0,0); 
  } 
  else if(lc == 1) 
  { 
    background(255,255,0); 
  } 
  else if(lc == 2) 
  { 
    background(0,255,0); 
  } 
  newms = millis(); 
  elapsedms = newms - oldms; 
  textSize(30); 
  fill(0,0,0); 
  text(elapsedms, 150,150); 
} 



The kids split into pairs and started working. After a while, a few groups were close – they could check for a certain elapsed time and then change the light’s state variable so it switched colors. They didn’t know how to reset the timer, so after about 20-30 minutes, most of the kids could change red-green-yellow and then didn’t know how to get back to red.

So I did a catch-and-release where we talked about the polling loop.  I showed boxes that represented the values of “oldms”, “newms”, and “elapsedms” each time through the draw() function. Some kids figured out on their own that the way to reset the timer is by assigning “oldms” to millis() when you change the light’s color. Others figured out different solutions  and it was interesting to see what they came up with.

The activity took most kids until the end of the class. On the third class, I asked all of the pairs to copy and paste their programs into OneNote. I then called up several groups to do a walkthrough of their solution. They did a really good job presenting. I like OneNote for this kind of sharing because the rest of the class could copy the code and run it to understand what the presenting group did.

Here are some of the solutions! I liked how each group approached it a little differently. Some used my variables and some made up their own. Some used nested “if” statements and some used complicated boolean expressions. Some reset the timer after each state change and some waited until after a complete cycle of the traffic light.

Luke and Andrew’s Method

Anna and Kay’s method

Ryan and Parker’s method

I enjoy seeing the students have their lightbulb moments, and it’s also fun to have the overachieving students that can’t resist being a little creative with their programs.

Maya’s Traffic Light

Ben and Anthony’s Traffic Light with car (it stops on red, goes on green, and speeds up on yellow)

I liked this workshop model with the teacher-led launch, the worktime in pairs, and then the student-presented summary. I think it was a good problem-solving activity for the kids, and for me it was a nice departure from the input-stuff-output model of programming.

 

 

 

Creativity and the Coordinate Plane

I’ve been teaching a 7th and 8th grade Computer Science Exploration class, going on my fourth semester now. As I always do, I am changing some things up this time. Starting with coding and then will dive into data and the internet and web design later.  In the past I’ve taken the plunge into coding once we’ve gotten background knowledge on data and information – because that’s how I learned it.

I am using Processing as the text-based language of choice this year. In the past, my first assignment was a problem-solving one in which kids had to make geometric shapes that I chose. I wanted to closely tie the learning in with math. However, since then, I came across this series of articles by and about Mitch Resnick: one of the creators of Scratch from the MIT Media Lab. He writes about the power of creative coding, here.  He also muses on the Hour of Code event, which I love but he makes some good points about. The power of computing is sometimes that you can use it to solve a specific puzzle… but often that you use it as a form of creative expression and open-ended modeling. Often you learn the things you want to learn because you are so driven to complete a project of your own design.

So for the kids’ first project this year, I put together a OneNote notebook summarizing some of the basic 2-D drawing functions in Processing. I also gave them this nice coordinate plane handout from Khan Academy.  We used it to do a few warmup exercises – for example, I would put some lines of code on the board, and they would draw what they thought it would look like and hold up their papers.

Then their assignment was “you’re going to create a free draw. You can make a character, a scene, or pixel art. Use at least three colors and five shapes. It should look like a purposeful drawing and not just random scribbles. I look forward to seeing what you make.”  It was very open. I didn’t have a specific problem in mind the students would solve. They would have to invent their own problems, and I ended up really liking the activity for that.

One student created multiple stars in different shades of blues and purples, and she had to make the same diamond shape but translated to different locations. She was determined to get it right and I heard her say “no, that’s not right” and redo her stars multiple times. She added a shooting star for effect.

 

Many students made pixel art and I enjoyed watching their different approaches. This student created pixel art by drawing lots and lots of squares with a thin black border around them.

 

Another student chose to do pixel art, but differently. Instead of drawing each square as a separate shape, he looked for bounded colored regions and used the beginShape() and endShape() functions, adding vertices.

 

Both students above had the issue of figuring out how big a pixel is, scaling their entire canvas and scaling and translating each pixel. They made it look easy!

I have a few students that enjoy “hacking” much more than they do planning and programming and so the activity was very different for them. For most students, this was an exercise in planning, mathematics, and attention to detail. For the hackers, they liked looking up something that was already done online and then modifying it and learning from it. One of these students found this program online.

A basic smiley face, curated from: http://www.openprocessing.org/sketch/31192

A basic smiley face, curated from: http://www.openprocessing.org/sketch/31192

He first downloaded the code, ran it and shouted “See! I’m done!” so of course you have a discussion about that and about how you can’t just turn in someone else’s work as your own. But I enjoyed seeing where he took the code from that point.
Student: Well, can I turn the smile upside down and add horns?
Me: Sure. I suspect the bezier function is the smile.
Student: Well how do I turn it upside down?
Me: These eight parameters are (x,y) coordinate pairs. You could plan it out on your graph paper, figure out what points would make the curve into a frown and then try those.
Student: Or…. I could do trial and error.
Me: I would plan it out and……
Student: Haha!! TRIAL AND ERROR!
Me: okay then.

So he did, and ended up making a very nice frowny face with horns. It became clear to me that his form of “trial and error” was in fact a great deal of pattern-seeking and mental math. Are planning and attention to detail valuable skills? Indeed. Are they his strengths? No, and he could get the job done well with the strengths that he had. Did he learn about the coordinate plane and color theory? Yes, I think he did. Maybe it’s ok to allow a kid to learn something new through their current strong skill set rather than the one they struggle with. This same student observed “In math class we use a different coordinate plane. This is really hard!” And I believe that code-switching is good for your brain.

Regardless of their approaches, the kids were really self-motivated to make a nice looking drawing. They owned the problems they were trying to solve. They got instant feedback, by running the program, on whether they solved their own problems correctly. Not everyone’s problems were of the same difficulty or even in the same domain. Many kids might have learned different things from what I intended them to learn. But did every kid learn? Yes, I really think so. Now I wish I knew how to put that magic into every assignment.