# Open School Games

Where did all this come from? Years of reading, writing and coding. You can see some of the debris below.

Think

Write

Code

What shall we read? I am interested in learning how to program a Raspberry Pi.1 I want to brush up on my understanding of how computers work, so I am rereading Charles Petzold's Code.2. Code takes me back to trying to communicate by secret signals with a flash light. I am hoping the Raspberry Pi can help me get back to that feeling of childish wonder when we discover that a little electricy channeled through an electronic circuit can allow us to transcend ordinary human limitations.

## Write

I need help here. I have written a little piece about using breadboards to build simple electronic circuits but it does not seem like something that Alice would enjoy reading. Can you help make this introduction to breadboards interesting? Post ideas to Facebook

## Code

In the spirit of getting back to basics let's build a very simple logic circuit. No matter how complex, every computer program has simple yes/no logical statements. We call these boolean conditions. If you have ever flipped a light switch, than you have ran a computer program. At my house the switches are positioned so that down turns lights off and up turns lights on. If we think about these as little computer programs we can imagine that down means false and up means true. This is fun and useful since I can answer any yes/no question with a flick of a switch but we can do more. If I have two switches both connected to the same light in parallel I can form a boolean OR condition.

If we can create an OR condition with parallel wires we can create a boolean AND condition with wires in a series.

To help keep track of what is going on let's label the buttons.

The wiring on the finished board represents this code statement:

if ((A OR B) AND (C AND D)){
enableLight();
}

Tips for helping a young student
• Press the buttons into the breadboard. Jumper wires are easy to work with but the buttons can be a little tricky. You will need to squeeze the prongs on the buttons just enough to get them to go through the holes in the breadboard. Also notice that the prongs are in pairs. You will want to make sure that each connected pair gets pressed into the same breadboard node. If the button behaves as if it is always pressed, you will need to pull the button out and rotate it 90 degrees.
• Remind your student that current will only flow through the LED3 in one direction. The long prong on the LED should be pressed into the node closest to the connection to the positive bus.
• Use a resistor to limit current flow. In these picures I have used a 220 ohm resistor and a variable voltage source set to a value just large enough to make the LED light up.