BrainTronics Intro
This lesson is an intro to circuits and physical computing. The BrainTronics shows how to connect electronic components using a breadboard.
Prerequisite
You must have completed some of the coding basic lessons and understand coding concepts like Variables, Loops, and Functions. And also have some understanding of the BrainPad API and the Input -> Process -> Output concept.
Breadboards
A breadboard is a plastic block with holes that are spaced out 0.1 inches apart. Internally, these holes have metal sockets that create a connection to the electronics components that are plugged in.

Each column of five holes are connected together internally, but this group is not connected to anything else. Not even the row next to it. In the image below the top side is orange and bottom is grey to show that these two sides are not connected to each other either.

Larger breadboards may also have additional rows on top and bottom, just like the one found on the BrainTronics base board.
The two rows have groups of 5 holes. These are different as they are all connected together on the entire row. This is typically used for power signal connections. This explains the blue and red lines.

The middle pin header consists of 3 columns:
- Orange -> Signal
- Red – > 3V
- Black -> Ground

It is a good practice to connect ground and power to the 2 rows as intended. Those can come from the middle pin header.

The middle pin header is an easy way to access the signals coming from the BrainPad.

A button, for example, can be connected to P0. The second pin from the button can go to ground. Note how even though the button has 4 pins, they are just 2 signals internally.

The button can then be used as a Digital() input or a Button().
Button using Digital() function
var btn = Digital(P0);
if (In(btn) == 0){
Print("Pressed");
}
else {
Print("Released");
}
btn = Digital(P0)
if In(btn) == 0:
Print("Pressed")
else:
Print("Released")
Button using Button() function
var btn = Button(P0,0);
if (In(btn) == 1){
Print("Pressed");
}
else {
Print("Released");
}
btn = Button(P0,0)
if In(btn) == 1:
Print("Pressed")
else:
Print("Released")
Connect components to each other can be done through the internal connections of the breadboard. Let’s add an LED with its needed current limiting resistor to P1.

The code can be modified to blink the LED.
var led = Digital(P0);
while(true){
Out(led,1);
Wait(1);
Out(led,0);
Wait(1);
}
led = Digital(P0)
while True:
Out(led,1)
Wait(1)
Out(led,0)
Wait(1)
What’s Next?
Start adding/building other components and use what you have learned in the In & Out Elements lesson.
BrainStorm
What might be the history behind breadboards? Solder-less circuit is appreciated for quick prototyping and is used by millions of engineers and makers around the world. They are also as useful for schools and education.