Beginning of the year in CS and Electronics!

I’m now a couple of weeks into the 2016-2017 school year, and I really think things are off to a good start. This year marks a bittersweet milestone for me. This will be my ninth year teaching. I was a software engineer for nine years. After this year, I’ll have been teaching longer than I was an engineer. I guess this is my real job now!

I have three regular-length classes I teach this year, and they’re pretty much the same as last semester: Web 2.0 (our required quarter-long 6th grade tech class), Computer Science Explorations, and Electronics (both of these are semester-long electives for 7th and 8th graders).

I’ll also teach a couple of enrichment classes, for a shorter time and for no grades. I’ll blog about those once they get started!

In Web 2.0, I start the semester right away by introducing Scratch. It provides much more than just coding at the beginning. Students learn about data privacy as we talk about creating a login and password, and facilitate the discussion with their parents so they can get their accounts confirmed. We go over the Scratch community guidelines and talk about what it means to be a good internet citizen.

We dive into coding by exploring the “motion” and “looks” blocks and having students write a story. Sixth graders have a funny and strange sense of humor and I always get quirky programs from them, including things like farting, flying hippos and a purple Morgan Freeman in front of a black hole.

A sixth-grader's imagination, in Scratch.

A sixth-grader’s imagination, in Scratch.

"Did you code a farting hippo?" "Yes I did!"

“Did you code a farting hippo?” “Yes I did!”

As we get into more challenging aspects of coding, we’ll continue to spiral back to the community guidelines, and we’ll learn about proper commenting, remixing, reusing and giving credit.

For the Computer Science Exploration class, we’re starting with coding right away in Processing. After doing some basic lessons on the coordinate plane, we learn about shape and color commands, and the students have to plan and create a free-draw program. I’ve blogged about this assignment before and enjoyed it this time around as well. Here’s some of the work from the kids.

Pixel art in Processing.

Pixel art in Processing.

This student imagined a solar system model in Processing.

This student imagined a solar system model in Processing.

And in Electronics, my teaching partner, Tracey Winey, and I decided to start the semester with circuits and Arduino, and then in the second quarter we will explore the engineering design process with sustainable lights in Engineering Brightness. I love our Arduino program and the kids have so much fun with it. So far they’ve all been able to make multiple lights blink and they are just so happy when they make it all work. Coding is fun, but coding when you’re interacting with something in the real world is extremely rewarding – we are having literal light-bulb moments.

The Allen Distinguished Educator program and LearnBig worked with us to develop a DIY guide on the Arduino light-up music boxes, and we actually had our kids use the professional video to work on their first project. They enjoyed it and said the videos were very helpful.

Students show Mrs. Winey their blinking lights.

Students show Mrs. Winey their blinking lights.

We asked the students to write reflections on Google Classroom about the blinking-light activity and their comments were gushing with positivity.
“i really was confused at first but now i get it and it is very fun!”

“I learned how to code, because I didn’t know how to code before. I really liked just the learning aspect of it because I have always wanted to code and I finally learned how to.”

“I learned how to use Arduino. I liked that I actually can make this board light up. it just felt nice.”

“I learned that it really isn’t that hard to program and arduino, and I really liked this! I just know I am going to have a lot of fun with these! Thank you so much for the opportunity!”

“I learned that this is a awesome class and that there was a lot of cool and hard steps to get to where i am i would have to say that i dont just like but love this class”

Wow, so many feels! I love being able to come back to those later in the year and reminding the students how far they’ve come and what they have learned!

As a final note, the number of girls taking CS and Electronics has slowly crept upward, although the numbers aren’t what I hoped they would be, and they probably never will be as long as learning computer programming / computing is considered optional. I have 4 girls in Electronics, and 12 total in my two sections of CS. It’s better than my first year when I would have one girl and 30 boys in a programming class, but we continue to be part of the problem when it comes to inequitable access to learning programming. The ability to program a computer won’t get less important as these kids graduate, and I wish for all of them to be able to participate in the world as inventors and creators.

I had my CS students do a little activity about their perception of programmers, and I’ll blog about that next time!





The Allen Distinguished Educator program and grants

In February, my teaching partner Tracey Winey and I received the Allen Distinguished Educator award. I want to tell you a little about the program as there are some possible ways for you to get involved! (Hint – there’s money available!)

The program was spearheaded by Paul Allen, and it seeks to highlight and further the spread of innovative education programs in computer science, engineering, and entrepreneurship. The program looks for teachers who are “breaking the mold” in these areas, re-imagining what education looks like in a variety of school settings. There are ADE awardees who teach all grade levels, from large and small schools, from charter, private, and public schools. What we have in common is that we believe in students’ ability to be creative problem solvers – we believe in individualized, project-based learning – we believe a 21st century education is not just about modern tools but allowing those tools to be used powerfully. We’ve created programs that look at learning in different and exciting ways. The ADE community helps us share our work and network with each other and with you.


Video of the ADE class of 2016 at SxSWEdu

Tracey is the media specialist at our middle school, and I’m the computer science and electronics teacher. She has taken the lead at turning our school’s media center into a social hub and makerspace, filling it with engaging technology, a creative spirit, a sense of adventure. I have worked hard to grow the computer science and engineering program at our school, to make programming just another creation tool we use to solve problems and to make engineering part of the everyday culture. We have our separate sandboxes but  we work together on an Electronics class and program called Engineering Brightness. We share a lot more about this program and what we’ve learned from it on the ADE website.

On the ADE website, you’ll find Micro-documentaries, Roadmaps, and Do-It-Yourself guides. A team from the Allen Distinguished Educators program, including a video production team from LearnBig, an e-learning company, came to our school and spent three days with us creating these products. It was exciting for me – my first time working with a professional team of videographers and writers. They listened to our stories and inspected our lesson and unit plans, and turned them into video products I’m really proud of and excited to share. It’s interesting to see an outside perspective of myself as an educator. It’s not the whole story of me and Tracey, but I like the story they told.


Making the DIY guide with the video crew from LearnBig. They do wonderful work.

I’m not a perfect educator or person. Going through the process of documenting and videoing my life as a teacher has laid bare the areas where I want to improve as well as my strengths. I’m really humbled to be in the company of the other ADE’s and suffer from imposter sydrome as much as the next person. I am, however, firmly committed to honoring my students as creative people with an interest in exploring the world around them, playing and solving problems, and I’m committed to learning alongside them – I stay grounded in that philosophy.

You can get involved in the Allen Distinguished Educator program! The grant application period just started for the DIY grants. These grants will award $1000 for you to implement one of the DIY guides on the web site. Tracey and I created the DIY guide about making Arduino-based music boxes with middle schoolers. $1000 would be enough to get a class set of Arduinos so you can get involved in physical computer science! I hope you apply for a project that is suited for you. All of them are rigorous and interesting and innovative for the students and teacher.

Let me know if I can do anything to help you with a grant proposal! And if you’re interested in joining the next class of ADE’s, watch the web site for application information this fall.


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: . 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:

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:

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.


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”.


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:

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 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 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.

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.


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


The cards are here:

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.

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:


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.



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 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.



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.


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.


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.


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() 
  ready = 0; 
  oldms = millis();
  newms = millis(); 
  elapsedms = newms - oldms; 
  interval = 5000; 
void draw() 
  if(lc == 0) 
  else if(lc == 1) 
  else if(lc == 2) 
  newms = millis(); 
  elapsedms = newms - oldms; 
  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.




National Summit on Teacher Leadership #2016NSTL

I had the privilege of attending the National Summit on Teacher Leadership in Washington, DC over the weekend of February 5-6. This summit involved the Department of Education, the Council of Chief State School Officers, the National Education Association, and the American Federation of Teachers. It was an awesome accomplishment in itself to get representatives from the four groups in the room at the same time. The purpose of a summit is to generate ideas. I was selected to be a teacher-leader representative from the NEA and had three peers from each of the other three organizations: Jeff representing the CCSSO, Kiragu representing the AFT, Karuna representing the Department of Education. Here we are with Dr. Andy Hargreaves, a researcher in leadership and teacher leadership programs. He’s the author of the book Uplifting Leadership.

Jeff, Kiragu, Dr. Hargreaves, Karuna, and me.

Jeff, Kiragu, Dr. Hargreaves, Karuna, and me.

Teams from over 20 states, plus the Department of Defense school system, attended the summit. We sat at a large table and brainstormed around questions having to do with leadership and the teaching profession. Each of the teacher-leaders moderated a session. Each session had a central question. My job, and the job of the other teacher-leaders, was to help guide the discussion, keep it on topic and on time, allow everyone a voice, and keep the discussion solution-focused.

The leaders of the four partner organizations were present and participated in the discussions. It was exciting and so important to hear all of our leadership on the same page. I also got a small collection of celebrity photos. I missed getting a picture with Chris Minnich who was there also.

The discussion started slowly and conservatively at first. We later became more passionate, sometimes emotional, sometimes solution-focused, sometimes preachy. We touched on many different themes around teacher-leadership and I felt we covered an awful lot of ground.

I would like to share a few stories from the summit.

One of my fellow moderators is an incredible and dedicated teacher from West Baltimore. His students can’t drink the water in their school building. They don’t have heat consistently. Computers, robots, musical theater, speech and debate, and science bowl teams are laughably inaccessible. Remember the riots in Baltimore last year? Teenagers smashed a police car. Students from a school with no drinkable water, no heat, no certified math teacher, 50% turnover of teachers every year, poor access to computers and modern learning tools. The national guard was sent in to deal with the rioters. Imagine knowing the government has the money to send in the military to deal with your students… but somehow, no money for drinkable water.

One participant gets her students involved in community service projects, engaging the community in dialogue about race and equity, looking for ways to help their neighbors. She knows well that her students won’t make the top test scores. She hopes to have them measured by different success measures. If your kids are engaged in real-life projects, searching for problems in their community and actively solving them and communicating about it – if they are kind to each other and productive and informed – have you done a good job?

Another participant helped me understand the world of professional development a little better. As she talked about the best professional development she ever had – in her case, it involved a book study, a conference, an EdCamp, and then a presentation she designed and presented to fellow teacher-learners – I realized that the path to teacher leadership can’t involve canned professional development or standardized metrics. You will realize the potential of leadership if your learning is personalized, designed by you, and where the success metrics are matched to your goals. I wonder how we achieve this for everyone in our profession.

I made a little slide show about the major themes from the weekend. If you look at the whole picture, I think an action plan starts to become clear. But it has to match your needs and your students’ needs. What will you do at your school?

National Summit on Teacher Leadership

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:

A basic smiley face, curated from:

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.

Arduino Final Projects by Middle Schoolers

This was my 3rd semester teaching an Electronics class for 7th and 8th graders, and I’m learning more and more every time I teach it.  In this class, I want students to learn the basics of electricity, circuits, and programming – and I also want them to learn a maker mindset. How to invent, remix, tinker, recover from setbacks, persist through difficulties, use your resources, collaborate with others. How to teach yourself what you need to know. How to present your project to others so they can build on it and make it even better.

I use some formal lessons, but this class is not as structured as a programming or computer science class. For the most part, students are given resources and inquiry questions, and they use the resources to teach themselves what they need to know. Everyone starts in a different place. Everyone has different needs. I want them to create something challenging that they’re proud of – a launching point for future exploration and learning in the world of invention.

I love the projects the kids made! Many made interactive holiday displays, and I got a great variety of others including videogame-themed projects, an LED cube, games, and even a car.  I created a simple Google Sites page to showcase their work.



I also have some reflections on the semester and the class in general. The learning is just as good for me as it is for the kids.

  • Purposeful learning: I believe in giving the students a good foundation in circuits such as understanding measurements and parallel and series circuits. However, students report to me that they find the beginning of the class “boring” and I don’t think I connect it well to the Arduino projects later. I’ve been involved with a project called Engineering Brightness, spearheaded by Tracey Winey, our media specialist, and John Howe, our assistant principal. It’s part extracurricular and part co-curricular, where students build lanterns in our school’s makerspace to send to third-world countries. My kids get involved with the EB program through soldering lessons, field trips, and guest talks and Skype sessions, but it has not been fully interwoven into the class up to this point. Tracey and I have been planning to co-teach this coming semester – we’ll use the EB project to teach basic circuitry and the innovator’s mindset, and infuse cultural/global awareness into Electronics class. I’m really excited about making this partnership stronger. The kids will understand the circuitry much better with this style of learning. Imagine learning about serial and parallel circuits, volts and amps by designing your own lantern for other people. They will love what they’re doing and find it more purposeful. There’s a good body of research that shows this is how to draw girls into engineering, too.
  • Open-source culture: The open nature of Arduino is what makes the platform so beautiful to work with. I have encouraged students to remix found projects and to share their work, but haven’t really tapped into the community to make their sharing more real. One thought I have here is that there is a style of communication that comes with sharing projects. Look at good projects you find on, or, or youtube or any of the Arduino sharing sites. Look at some that are not as well done. There’s a structure and a style that makes your project accessible, interesting, replicable, and fun. Kids in the modern world need to learn to communicate in the medium that best suits their work, to code-switch and adapt their style as needed. I wonder how to teach open-source sharing and communication to middle schoolers. I would love to make the writing and video editing and photography and commenting a really key part of the class, as I’m not satisfied with the work I’m getting at the moment. It would be so important for the Engineering Brightness part of the curriculum as well as the Arduino part.
  • Appropriate level of challenge: I ran into challenges you always run into with a project-based class. Some students got in over their head and tried to do too much. Some kids who were perfectly capable of finding answers on their own raised their hands many times each class and waited for me to help them. Some finished early with a half-baked project that didn’t meet requirements but did not want to challenge themselves further. Work was shared unevenly between partners. Some finished early and asked me what they should do for the next three class periods. Some pushed the deadline right up until the last minute of the last day of class. Some did not understand how to read rubrics or project guidelines. I expect all of these challenges each semester, and sometimes I do a good job working with these situations, but not always. I continue to look for good structures for project-based learning. It’s really hard with one of me. This may be a great opportunity for me and my teaching partner next semester to put some good practices in place for the kids.


Computer Science Education Week at Preston

I’m late blogging about this because our days were so busy with CS Ed Week! I owe a huge debt of gratitude to my partner in crime, Tracey Winey (Twitter: @premediawine) , who listened very nicely when I said “I have some ideas about Computer Science Education Week I’d like to brainstorm with someone”, and she agreed to dive right in and plan a bunch of activities with me. She’s an outstanding organizer and is becoming a darn strong engineer as well, so the world better watch out.

We arranged for teachers to do an Hour of Code with their students over the course of the week, in their regular classes. Many students are doing multiple Hours of Code and they love it. The three activities garnering the most positive feedback from students are the Minecraft Hour of Code on, the Anna and Elsa Hour of Code on, and the BitsBox Hour of Code (which actually lets you download your apps to your mobile device!). I love how the Hour of Code makes coding accessible and fun for every student. Tracey and I wanted to infuse coding into a little bit of a cultural celebration at school. We envision that students should not see coding as a niche activity for a geeky few, but as a normal problem-solving tool that everyone uses.

We set up some open houses in the media center and scheduled students to come to them and take tours. We arranged for current CS and Electronics students to be tour guides and take their friends around different “exhibits” having to do with computer science. Tracey managed the open houses as I had classes to teach during most of them. We had:

Interactive Code, Art, and old Video Games on Monday:

That is PONG, people.

That is PONG, people.

Arduino Day on Tuesday:

Experimenting with a reaction-time game and a pac-man simulator on Arduino.

Experimenting with a reaction-time game and a pac-man simulator on Arduino.

Robot day on Wednesday:

Students love NAO robots and Lego EV3 Robots.

Students love NAO robots and Lego EV3 Robots.

Minecraft day on Thursday:

An Hour of Code with Minecraft Turtles in the lab. Very popular workshop.

An Hour of Code with Minecraft Turtles in the lab. Very popular workshop.

On Friday, we had our first annual Preston Middle School Code-a-Thon. I blogged about how we envisioned it working previously.  We were able to accept almost 80 kids, and it came down to 11 beginner teams and 8 advanced teams. The beginner participants were mostly girls, and the advanced groups were half girls. It was busy but a lot of fun.

We recruited some adult volunteers from the community… some Preston parents who are engineers, along with some engineer friends and retired teachers, and a staff member from the Larimer Humane Society. We had four judges and eight technical mentors, and we divided them up to work with beginners or the advanced teams.

Tracey and I gave a presentation about the code-a-thon. We talked about how code-a-thons are also called hackathons, and they are engines of innovation. Google is famous for its hackathons, and hackathons usually have a theme – Virtual Reality, Rural Life, and Social Services are a few. Sometimes, employees even stay overnight and bring their sleeping bags, and code through the weekend to come up with their solution. Everyone presents at the end. We presented the theme:
Animal Welfare!  The kids were very excited. We showed this quick YouTube clip to get the students thinking about different problems they could solve related to animal welfare.

The kids started by brainstorming, and Tracey set them up all over the media center with SMART boards, regular whiteboards, a SMART table, a Kapp, butcher paper, desktop computers and laptops. The kids had to choose a problem or a need to address, and what language they would code in. I had set up some group accounts on Khan Academy, Open Processing, and Scratch. One group of students chose to use MIT App Inventor, one chose BitsBox, and three groups decided to create coding solutions using the NAO humanoid robot.  We offered snacks every hour, and had the kids turn their programs in using Google Classroom. They worked from 8:15 until 11:15, and then they gave presentations to the judges. We saw programs on animal abuse, factory farming, saving penguins, catching poachers, endangered animals, quite a few perfect-pet quizzes, a vet program, and a robot dog trainer. While the judges were deliberating, our Humane Society volunteer gave a presentation about what they do and how they help animals in the community. Finally, the judges returned and we gave out top-four prizes in each category.

It was awesome. The kids who gave us feedback said they loved coding something that had a purpose to it. That they really enjoyed having a reason for coding, learning and being social and of course having snacks. I heard from a couple of parents of beginners that their kids were so proud of their coding and had so much fun. Many kids asked if we could do it again. We are pretty exhausted – but we probably will!

Here is a link to many of the programs created by students during the code-a-thon.


I hope you like this slideshow of the code-a-thon. We had a great time!

This slideshow requires JavaScript.