Arduino Ladder · Bozoma Innovation Hub

Bozoma Innovation Hub  ·  Arduino Ladder  ·  Band 0

Bench Ready

Your first band. You will learn what the board is, get it talking to your computer, and make a light blink in a pattern that belongs to you.

About 3 hours. You do not need to finish it in one sitting. Nothing here uses the breadboard yet.

Sketches for this band

Click one to save it, or get every sketch at once from the downloads page. Each file opens with a plain-English header telling you what it does and how to wire it.

Start here

What this band is for

Right now the Arduino board is a strange object. By the end of this band it will be a tool you know how to use. That is the whole job.

You will not build a circuit yet. You will not use the breadboard. You will use one small light that is already built into the board, so that if something goes wrong, you know the problem is the computer or the code. It cannot be the wiring, because there is no wiring.

What you need in front of you

  • Your Arduino Uno board
  • The USB cable that came with it
  • A laptop or computer
  • Your kit box, unopened is fine for now
  • A pen and something to write on

By the end you will be able to

  • Point at any part of the board and say what it does
  • Send a program from your computer to the board
  • Read a program and say what each line does
  • Change a program and send it again
  • Read an error message and find the line it is talking about
Three rules to start with
  1. Unplug the USB cable before you change any wiring. Plug it back in after.
  2. Never join the 5V pin straight to the GND pin. That is the one mistake that can damage the board.
  3. If you are stuck on the same problem for 30 minutes, stop and ask. Take a photo of your board first.

You will not touch wiring in this band, so rules 1 and 2 do not bite yet. Learn them now anyway.

A fourth rule arrives at Band 6, when a battery pack turns up: never put more than 5 volts on an Arduino pin. It cannot bite you before then, because until Band 6 all the power in your build comes from the board itself.

Two words this course uses a lot
build log
A page of notes you write for each band, as you go. What you set out to build, what went wrong, what you tried, and what fixed it. A notebook, a phone note or a document all work. There is a full list of what goes in it on the course home page, and the messy parts matter more than the tidy ones.
claim a band
Showing somebody the four things a band asks for: the thing you built, your build log, your Check yourself answers, and a 90 second explanation of one line of your own code. Band 8, the last one, asks for a fifth: an honest write-up of whether it worked. If you are working entirely on your own, keep them together in one folder anyway. They are how you can tell you actually finished.
Part 1

What is an Arduino?

15 min

An Arduino is a very small computer on one flat board.

It is not like a laptop. It has no screen. It has no keyboard. It cannot browse the internet. It does one job: it follows a list of instructions that you give it, and it does that over and over until you unplug it.

What makes it useful is that it can control electricity. It can switch a light on. It can turn a small motor. It can read a sensor and find out how bright a room is, or how warm, or how far away something is. Then it can decide what to do about that.

The list of instructions you give it is called a program. In the Arduino world we call one program a sketch. Both words mean the same thing here.

Look at your board

Take the board out and hold it. Compare it to the picture below. Find each labelled part on the real board before you read on.

Digital pins (0 to 13) Power pins Analog pins (A0 to A5) USB socket Power socket The light marked L The main chip
The seven parts of the board you need to know in this band. Your board may look slightly different if it is a copy rather than an original, but every one of these parts will be there somewhere.

What each part does

PartWhat it does
USB socketWhere the cable from your computer plugs in. It carries two things at once: the electricity that powers the board, and the program you are sending it.
Power socketA second way to give the board electricity, from a wall adapter or a battery. You do not need it while the USB cable is plugged in.
Digital pinsThe row of small holes along the top, numbered 0 to 13. Each one can be switched on or off by your program. Wires go into these holes.
Analog pinsThe holes marked A0 to A5 along the bottom. These are for reading sensors. You meet them at Band 4.
Power pinsAlso along the bottom. The important ones are 5V, which supplies electricity, and GND, which is where electricity returns to. There is more than one GND hole. They all do the same thing.
The L lightA tiny light already built into the board. It is joined to pin 13. This is the light you will blink in this band.
The main chipThe black rectangle in the middle. This is where your program is stored and where it runs.
Words to know
pin
One hole on the edge of the board that a wire can go into. Each pin has a number or a name printed next to it.
GND
Short for "ground". The hole electricity returns to after it has done its work. Every circuit you build needs one.
5V
A pin that always supplies electricity at 5 volts, as long as the board has power.
program
A list of instructions for the board to follow.
sketch
The Arduino word for one program. A sketch is saved in a file that ends in .ino.
Part 2

Get your computer ready

25 min

You need one piece of software: the Arduino IDE. It is free. It is the program you write in, and it is the program that sends your sketch to the board.

IDE is just a name. You do not need to know what the letters stand for.

Download it. Go to arduino.cc/en/software in your web browser. Find the download list. Choose the one that matches your computer: Windows, macOS, or Linux.

If the page asks for moneyIt will offer you a chance to donate, with a button that says something like "Just download". Click that. You do not have to pay.
If your internet is slow or expensiveThe file is large, a few hundred megabytes, and it will not install on a phone. You only need to download it once, on one computer. If data is a problem, ask somebody who already has it to copy the installer onto a USB stick for you. The installer file is all you need. There is nothing else to fetch.

Install it. Open the file you downloaded and follow what it asks. On Windows it may ask permission to install drivers. Say yes to all of them. Those drivers are what let your computer see the board.

Open it. Start the Arduino IDE. The first time it opens it may take a minute.

You should seeA window with a large white area in the middle, a row of buttons at the top left, and a black area at the bottom. In the white area there is already some text, starting with void setup().

Learn the two buttons you will use most. At the top left there is a round button with a tick inside it, and next to it a round button with an arrow pointing right.

  • The tick is called Verify. It checks your code for mistakes. It does not touch the board.
  • The arrow is called Upload. It checks your code and then sends it to the board.

Hover your mouse over each one and the name will appear. Do this now so you are sure which is which.

Now plug in the board

Connect the USB cable from your computer to the board.

You should seeA small green light on the board comes on and stays on. It may also start blinking a light on and off, because new boards usually arrive with a blink program already inside them.
If no light comes onTry a different USB cable. Some USB cables are made only for charging phones and cannot carry data. They look exactly the same. This is the most common problem people hit in their first week, so try this before you decide anything is broken.

Tell the IDE which board you have. In the menu at the top, click Tools, then Board, then choose Arduino Uno.

Tell the IDE where the board is. Click Tools, then Port. You will see a short list. One of them is your board.

If you are not sure which one, do this: unplug the board and look at the list. Note what is there. Plug the board back in and look again. The one that just appeared is your board. Choose it.

If the Port menu is empty or greyed outTwo things cause this, and you should check them in this order.

One: the cable. Many USB cables are charge-only and carry no data. Swap it for a different one and try again.

Two: the driver. Most starter-kit boards, including the Elegoo one, are copies rather than original Arduinos, and they use a different USB chip called the CH340. Every operating system needs a driver for it, not just Windows. Search the web for “CH340 driver” plus the name of your system, install it, then close the IDE completely and open it again. On Linux the driver is usually already there but you also have to give yourself permission to use the port: run sudo usermod -a -G dialout $USER in a terminal, then log out and back in.
Words to know
IDE
The Arduino software on your computer. You write sketches in it and send them to the board from it.
Verify
The tick button. Checks your code for mistakes without touching the board.
Upload
The arrow button. Sends your code to the board.
port
The name your computer gives to the socket your board is plugged into. You have to tell the IDE which one to use.
driver
A small piece of software that teaches your computer how to talk to a device.
Part 3

Think about it first, away from the computer

10 min

Before you touch any code, do this small activity. It takes ten minutes and it will make the next part much easier to understand.

Write three instructions on a piece of paper, in big letters:

1. Stand up.    2. Say your name.    3. Clap once.

If you have someone with you

Hold the paper up where they can read it and keep holding it there. This matters. They must be able to see it the whole time.

Tell them the rule: "Do instruction 1 one time only. Then do 2 and 3 over and over, without stopping. And read the paper again every single time before you do them."

Let them run for about a minute.

You should seeThem standing up once at the very start, then saying their name and clapping, again and again, in a steady rhythm.

Now, while they are still going, cross out instruction 2 and write something different above it, like "hop once". Do not say anything. Just change the paper.

You should seeThey carry on saying their name for one more round, because they had already read that line. Then, on the next round, they read the paper again, notice it has changed, and start hopping instead.
If they never noticeThey have stopped reading the paper and are working from memory. Remind them of the rule and try again. That is worth knowing about, and question 2 below is about exactly that.

If you are on your own

Prop the paper up against something, where you can see it while standing.

Do instruction 1 once: stand up.

Now do 2 and 3 over and over, twenty times, reading the paper each time before you do them. Say your name, clap. Read. Say your name, clap. Read. Count the rounds out loud.

You should seeThat you only stood up once, at the very beginning, and everything after that repeated.

Now stop. Change instruction 2 on the paper to something different. Then start again from instruction 1.

Notice what you had to do there: stop, change the paper, and start again from the top. You could not change it halfway through and carry straight on. Hold on to that.

Write your answers down before you go on
  1. Which instruction happened only once? Which ones happened again and again?
  2. If somebody helped you: when the paper changed while they were still going, did the change happen straight away? What did they actually have to do first?
    If you did it alone: you could not swap the paper halfway through without stopping. What exactly did you have to do to get the new instructions running? Write down each thing, in order.
  3. Write down one thing you do once each morning, and one thing you repeat all day.

Hold on to what happened in question 2. Stopping, taking the new instructions, and starting again from the top is exactly what the board does every time you press Upload. It cannot change its instructions while it is running them.

Part 4

Read the program before you run it

8 min

Here is your first sketch. Do not upload it yet. Read it first.

It will look strange. That is normal and expected. You are not supposed to understand all of it yet. Read it anyway, guess what it does, and write your guess down. Then we will go through it properly.

b0_01_blink_given.ino
void setup() {
  pinMode(13, OUTPUT);
}

void loop() {
  digitalWrite(13, HIGH);
  delay(1000);
  digitalWrite(13, LOW);
  delay(1000);
}
Write down your guesses now, on paper
  1. How many times do you think the line with pinMode happens?
  2. How long do you think the light stays on? How long does it stay off?
  3. What do you think happens after the very last line finishes?
  4. If you deleted both lines that say delay, what do you think you would see?

Do not skip this. Guessing and then finding out you were wrong is the fastest way to learn this material. Nobody is marking your guesses. Question 4 catches nearly everybody, including people who have been doing this for years, so guess anyway.

Part 5

What every part of that code means

25 min

Now we go through it slowly. Every symbol. Nothing skipped.

The two groups

Look at the sketch again. It has two blocks. Each one starts with a name and a pair of curly brackets.

void setup() {
  ...
}

void loop() {
  ...
}

These are two groups of instructions. The board treats them very differently:

  • setup runs one time, right at the start, when the board is switched on or has just received a new program.
  • loop runs again and again forever, from its first line to its last line, then back to its first line, until the board loses power.

This is the same thing that happened in the paper activity. Stand up once. Then say your name and sit down, over and over.

Every Arduino sketch must have both of these groups. Even if one of them is empty.

The symbols

SymbolWhat it is doing
voidA word that has to be there before the group name. It is telling the computer that this group does not hand back an answer when it finishes. For now, just accept that groups start with void. You will understand why at Band 5.
setup and loopThe names of the two groups. These exact names are required. The board looks for them. You cannot call them something else.
( )Round brackets. After a group name they are usually empty. After an instruction name they hold the details that instruction needs.
{ }Curly brackets. These mark where a group begins and where it ends. Everything between them belongs to that group. Every { must have a matching }.
;A semicolon. This is the full stop of code. Every instruction ends with one. Forgetting it is the most common mistake there is, and you will do it many times.

The instructions, one at a time

pinMode(13, OUTPUT);

This says: pin 13 is going to be used for sending electricity out.

Break it into pieces:

  • pinMode is the name of the instruction. It means "set up how a pin will be used".
  • Inside the round brackets are two details, separated by a comma.
  • 13 is which pin you are talking about.
  • OUTPUT means this pin will send electricity out to something, rather than read something coming in.
  • ; ends the instruction.

It is in setup because you only need to say this once. The pin does not forget.

digitalWrite(13, HIGH);

This says: switch pin 13 on.

  • digitalWrite means "switch a pin on or off".
  • 13 is the pin.
  • HIGH means on. The pin now puts out 5 volts.

The opposite is digitalWrite(13, LOW); which means switch pin 13 off. The pin drops to 0 volts.

There is no in-between. With digitalWrite, a pin is fully on or fully off. Getting in-between brightness is what Band 2 is for.

delay(1000);

This says: wait here and do nothing.

The number is in milliseconds. A millisecond is one thousandth of a second. So:

  • delay(1000); waits one second
  • delay(500); waits half a second
  • delay(2000); waits two seconds
  • delay(100); waits one tenth of a second

To turn seconds into the number you need, multiply by 1000.

Why the delays have to be there

The board works through instructions very fast. Millions of them a second. Without the delays it would switch the light on and off so quickly that your eye could not follow it. The light would look like it was on all the time, at about half brightness.

That is the answer to guess number 4. Check what you wrote. Were you close?

Two rules about typing

Capital letters matter

pinMode is correct. pinmode and PinMode and PINMODE are all wrong and will not work. The same is true for digitalWrite, HIGH, LOW and OUTPUT. Copy the capital letters exactly as you see them.

Spaces mostly do not matter

The computer does not care about extra spaces or blank lines. It cares about the words, the brackets and the semicolons. The spaces at the start of the lines inside the curly brackets are there for humans, to make the shape of the code easy to see. Keep them anyway. It is a good habit.

Part 6

Now run it

20 min

Get the sketch onto your computer first. Clicking the link usually just shows the text on screen instead of saving it. So do this instead:

  • Right-click the sketch link, or press and hold it on a touchscreen.
  • Choose Save link as (some browsers say Download linked file).
  • Save it somewhere you will find again. Your Documents folder is a good choice. Make a folder called Arduino inside it and put every sketch there.

Then open it. In the IDE, click File, then Open, go to the folder you just saved it in, and choose b0_01_blink_given.ino.

If you downloaded the whole zip insteadA zip is a folder squashed into one file. Double-click it to unsqueeze it. On Windows you may have to choose "Extract all" first. You will get a folder with every sketch in it.
If the IDE says the file must be in a folder with the same nameThis is normal. Click yes and let it fix it for you. The Arduino IDE wants every sketch to sit inside a folder named after it.

Press Verify, the tick button. Wait a few seconds.

You should seeA message at the bottom saying it is done compiling, and no red text. Nothing happens on the board. That is correct. Verify only checks the code.

Press Upload, the arrow button.

You should seeTwo very small lights on the board, marked TX and RX, flicker quickly for a second or two while the program crosses the cable. They sit close together near the USB socket. The light called L, the one you will be watching afterwards, is the one further away from that pair. Then a message at the bottom telling you it is done uploading.
If you get a red error about a port or being "not in sync"Go back to Tools and check both Board and Port are still set correctly. Unplugging the board can clear the Port setting. If it still fails, unplug the board, plug it back in, choose the Port again, and upload again.

Watch the light marked L. It is tiny. Find it on the diagram in Part 1 if you are not sure which one it is.

You should seeIt comes on for one second, goes off for one second, and repeats forever.
If nothing seems to changeYou may be watching the wrong light. The green light that stays on all the time is the power light. It is not the one. The one you want blinks. Also check the title bar of the IDE window shows the same file name you think you edited.

Check your four guesses from Part 4. Mark each one right or wrong. Keep the paper.

Where does the program actually live?

Many people think the program is running on their laptop and being sent to the board bit by bit. It is not. Prove it to yourself.

Unplug the USB cable from your computer while the light is blinking. The board goes dark, because it has lost its electricity.

Plug the board into a phone charger instead, using the same cable. Any USB charger will do.

You should seeThe light starts blinking again, in exactly the same pattern. Your computer is not involved at all.

Write one sentence explaining why it kept blinking. Keep that sentence. You will be asked for it when you claim this band.

When you press Upload, the program is copied into the chip on the board and stays there. It does not need your computer any more. It will still be there tomorrow, and next month, until you upload something different over it.

Read the worked example

Now open b0_02_signature_worked.ino and upload it. Watch it first, then read it.

This one blinks a signature: two short flashes, one long flash, then a rest. It is the kind of thing you will make yourself at the end of this band.

b0_02_signature_worked.ino
int ledPin = 13;
int shortFlash = 150;
int longFlash = 700;
int gap = 200;
int rest = 1200;

void setup() {
  pinMode(ledPin, OUTPUT);
}

void loop() {
  digitalWrite(ledPin, HIGH);
  delay(shortFlash);
  digitalWrite(ledPin, LOW);
  delay(gap);

  digitalWrite(ledPin, HIGH);
  delay(shortFlash);
  digitalWrite(ledPin, LOW);
  delay(gap);

  digitalWrite(ledPin, HIGH);
  delay(longFlash);
  digitalWrite(ledPin, LOW);
  delay(rest);
}

There is something new here. The five lines at the top give names to numbers.

int shortFlash = 150; means: make a name called shortFlash and put the number 150 in it. After that line, anywhere you write shortFlash, the board reads it as 150.

Look at how the rest of the sketch uses those names instead of numbers. delay(shortFlash) instead of delay(150).

Why bother? Two reasons. First, delay(shortFlash) tells you why that delay is there, and delay(150) does not. Second, if you want to change the short flash, you change one line at the top instead of hunting through the sketch for every 150.

You do not have to use this yet. Band 1 makes you feel the difference by measuring it, which works far better than being told.

Words to know
compile
Turning the code you wrote into something the chip can actually run. The Verify button does this.
upload
Copying the compiled program into the chip on the board.
millisecond
One thousandth of a second. 1000 milliseconds is 1 second.
int
The word you write when you are making a name for a whole number. Short for "integer", which means a whole number.
Part 7

Look closer

20 min

Three short activities. They look small. They are the part that makes the difference between copying and understanding.

a. Follow the code by hand

Go back to b0_01. Number the four lines inside loop() as L1, L2, L3, L4.

Copy this table onto paper and fill in the empty boxes. The first row is done for you.

TimeWhich line is runningWhat the light is doing
0 secondsL1comes on
0 to 1 seconds  
1 second  
1 to 2 seconds  
2 seconds  
2 to 3 seconds  
Check your table

0 to 1 seconds: L2 is running, light stays on. At 1 second: L3 runs, light goes off. 1 to 2 seconds: L4 is running, light stays off. At 2 seconds: loop has finished, so it starts again from L1, and the light comes on. 2 to 3 seconds: L2 again, light stays on.

The important thing to notice: the light is not "waiting to change". The board is sitting inside delay doing nothing at all. That will matter a lot at Band 5.

b. Meet an error message

Open b0_03_buggy_semicolon.ino and press Verify. It will fail. That is what it is for.

Here are lines 22, 23 and 24 of that file:

b0_03_buggy_semicolon.ino, lines 22 to 24
void setup() {
  pinMode(13, OUTPUT)
}

The semicolon at the end of line 23 is missing. Now look at the red message at the bottom of the IDE. It says something close to this:

b0_03_buggy_semicolon.ino:24:1: error: expected ';' before '}' token

Read that message piece by piece:

  • b0_03_buggy_semicolon.ino is the file.
  • 24 is the line number it is complaining about.
  • expected ';' means it wanted a semicolon.
  • before '}' token means it noticed when it reached the curly bracket.
Answer this before you fix anything

The message points at line 24. The mistake is on line 23. Why is it pointing at the wrong line?

The answer, and it is worth remembering

The computer reads your code from left to right, top to bottom. At the end of line 23 it does not yet know that anything is wrong, because an instruction is allowed to carry on onto the next line. It is still waiting to see the semicolon.

Then it reaches the curly bracket on line 24. A curly bracket cannot come next when it is still waiting for a semicolon. That is the first moment it can be sure something is wrong, so that is where it complains.

The rule to carry with you for the whole course: the error message tells you where the computer noticed, not where you made the mistake. Always look at the line above the one it names.

Now add the semicolon and check that it verifies.

c. A thinking question

In b0_01, imagine you swapped the two digitalWrite lines around, so that the LOW one came first and the HIGH one came second. Everything else stays the same.

Would someone watching the board see any difference? Write one sentence and say why.

Answer

After the first second, no difference at all.

On, wait, off, wait gives you exactly the same repeating pattern as off, wait, on, wait. Once something is going round and round, it has no beginning any more. The only difference is what happens in the very first second after you upload.

Part 8

Change it yourself

20 min

Now you change someone else's code before you write your own. This is deliberate. It is much easier than starting from an empty screen, and you learn just as much.

Work on a copy of b0_01. Use File then Save As to make a copy first, so you still have the original. Do all three tasks in order.

Bronze
Make the light blink twice as fast. Write down which numbers you changed and what you changed them to.
Silver
Make the time it is on different from the time it is off, so it looks like a heartbeat rather than a steady tick.
Gold
Make it flash three times quickly, then pause for two seconds, then repeat forever. Count how many lines your answer needed. Then work out how many lines it would take to flash ten times, and write that number down too.
A hint for Gold, if you need one

You do not need anything new. One quick flash is four lines: on, short wait, off, short wait. Three quick flashes is those four lines written out three times. Then one long delay at the end for the pause.

Yes, that means a lot of copying and pasting. That is the point of the exercise. Keep both of your numbers.

Keep the two numbers from Gold somewhere safe. At Band 2 you will learn a way of doing this same job where going from three flashes to ten costs you one character. Comparing the two ways is how you will understand why that tool exists.

Part 9

Make: your own signature

60 min
What to build

A blinking pattern that is yours and nobody else's. If six boards were blinking on a dark table, someone who knows your signature should be able to point at yours.

It is finished when all of these are true
  • It uses at least two different flash lengths, for example a short one and a long one
  • There is a clear pause, so a watcher can see where the pattern starts again
  • The whole pattern takes less than five seconds
  • You could tap the rhythm out with your hand before you wrote any code

How to go about it

Tap it first, away from the computer. Tap a rhythm on the table until you have one you like.

Write it down as marks on paper. Use a short line for a short flash, a long line for a long flash, and a dot for each gap where the light is off. The gaps matter as much as the flashes.

Something like: — · — · ——— ···· which is short, gap, short, gap, long, long rest.

Turn every mark into a number of milliseconds, including the dots. Write the number above each mark.

Remember: every mark is two lines of code, and every gap is two more

One flash is: switch on, wait, switch off, wait. So a pattern of five marks is twenty lines. That is normal, and it is exactly why Band 2 exists.

Now open the IDE and turn your marks into lines of code, one mark at a time.

Upload and watch. Does it match the rhythm you tapped? Adjust the numbers until it does.

Designing away from the keyboard is a habit worth building now, while the hardest thing you can get wrong is one light.

Also due this band: your kit list

Open your kit box. Go through it part by part. Write a list with the name of each part and how many of them you have.

If you do not know what something is, look at the paper that came with the kit, or search the web for "Arduino starter kit parts" and match the pictures. If anything is missing or broken, deal with it now rather than at Band 4, when you are halfway through a build and cannot finish.

Most missing parts have a substitute you already have, so check this list before you go looking for a shop:

  • Resistors: anything from 200 to 470 ohms works in place of a 220. The light is a little dimmer at the high end. Nothing is harmed.
  • LEDs: any colour works anywhere. The colours in this course are only so the instructions can name them.
  • Jumper wires: you can get by with fewer than the count given, by taking a wire out of a finished part of a build and reusing it, as long as you write down what you moved.
  • The buzzer, the light sensor, the potentiometer: these have no substitute. If one is missing you can still finish every other part of the band it belongs to. Skip that one part and come back.

If somebody is running this course for you, tell them now. If you are on your own, note it in your build log so you remember why a later part had to be skipped.

Show your work

Post a ten second video of your signature blinking, plus your build log for this band. Then look at two other people's signatures and check yours is different from both. If it is not, change yours.

If you are doing this course aloneThere may be nobody to post to and nobody else’s work to look at. That is fine, and it does not let you off this part. Do it this way instead: save the photos and the video into a folder named for this band, write the same notes into your build log, and then be your own second reader. Come back to your own sketch the next day, read it cold, and write down the one thing you would do differently now. That is the whole value of looking at somebody else’s work, and you can get most of it from your own.
If there is nobody else nearbySend your video to someone on your phone and ask them to describe the rhythm back to you. If you cannot do that, leave it for a day, then watch your own video fresh and write down whether you could still pick it out from a group. Say in your log which one you did.
Part 10

Check yourself

10 min

This is code you have not seen before. Do not upload it. Answer from reading only. Write your answers down, then check them.

void setup() {
  pinMode(12, OUTPUT);
  digitalWrite(12, HIGH);
}

void loop() {
  delay(2000);
  digitalWrite(12, LOW);
}
  1. What does the light do during the first two seconds?
  2. What does it do after that?
  3. How many times does digitalWrite(12, HIGH) happen in the first minute?
  4. Someone says: "the light stopped changing, so loop must have stopped running." Are they right? Explain.
  5. Add one line to make the light blink instead. Where does it go, and what is it?
  6. Which single line would you delete to make the light never come on at all?
Answers

1. It is on, and stays on. setup switched it on and nothing turns it off for two seconds.

2. It goes off at two seconds and stays off forever after that.

3. Once. It is inside setup, and setup runs one time only.

4. No, they are wrong. loop is still running, thousands of times. It is just that everything inside it is either waiting, or switching off a light that is already off. A program can be running perfectly and still look like nothing is happening. This is the question that matters most in this band. If you got it wrong, read Part 5 again before you move on.

5. You need digitalWrite(12, HIGH); inside loop. A good answer also notices you need a second delay after it, otherwise the light is switched on and off again too fast to see.

6. The digitalWrite(12, HIGH); line in setup. If you said delete pinMode instead, that is a common answer and worth understanding. Without pinMode the pin is still set as an input, and switching an input pin on does something different: it turns on a resistor inside the chip that lets through only a tiny trickle of electricity. Some lights glow very faintly on that, most show nothing. So it is a more confusing result than simply nothing at all.

Part 11

When something goes wrong

Work down this list in order. Do not skip. Most first-week problems are on it.

What you seeWhat it usually isWhat to do
No Port in the Tools menu, or it is greyed outA charging-only USB cableSwap the cable for a different one. This looks exactly like a dead board and it is not. Try this first, every time.
Red error mentioning "not in sync" or "programmer is not responding"Wrong Board or wrong Port chosenGo to Tools and set both again. If you are on Windows with a copy board, install the CH340 driver.
Upload says it worked, but nothing changedWatching the wrong light, or you edited a different copy of the fileThe blinking light is the tiny one marked L. Check the file name at the top of the IDE window is the file you edited.
A green light is on but nothing ever blinksThat green light is the power lightNothing is wrong with the board. It is showing you it has electricity. It has nothing to do with your program.
Lots of red errors that mention files you never wroteA missing semicolon or a missing curly bracket earlier in your sketchRead the first error, not the last one. Then look at the line above the one it names.
The IDE will not let you save, or asks about a folderArduino wants each sketch in a folder with the same nameLet it create the folder. Say yes.
Everything worked yesterday, nothing works todayThe Port changed when you unplugged the boardTools, then Port, choose it again.
Still stuck after 30 minutes?

Stop working on it. Get three things together: a photo of your screen showing the red error, your sketch, and one sentence saying what you expected and what actually happened.

Then send them to whoever is running this course for you, or to your build buddy, or to whatever group you were given at the start. Then move on to something else while you wait.

If there is nobody to send it toWrite the three things down anyway, in your build log. Putting the problem into words solves a surprising number of them on its own. Then work down the list above one more time, slowly, and if it is still stuck, leave it until tomorrow and come back to it fresh. Do not sit and stare at it.

Being stuck for half an hour is normal. Being stuck for three hours on your own is not, and it is the point where people give up on the whole course. Ask early.

Done

What you know now

Look back at where you started. You now know what the board is and what each part of it does. You can send a program to it. You can read a program and say what each line does. You can change one and send it again. You have met your first error message and you know the trick for reading it.

That is a real skill and you built it in one band.

Before you move on, make sure you have

  • Your working signature, and a video of it
  • Your kit list, with every part named and counted
  • Your build log for this band
  • Your two numbers from the Gold task
  • Your one sentence about why the board kept blinking on the phone charger
  • Five or six correct answers in Part 10, including question 4

Next is Band 1: Signal Tower. You will open the breadboard, build a real circuit with three lights, and make something a stranger can understand without you standing next to it.

Ship it

One video under sixty seconds, and one post of five lines. The video is the same one this band already asks you for as evidence, so this is not extra work. It is the same work, done once, somewhere a person can see it.

Point the camera at: your blink pattern, the one nobody else in the room has.

The four shots: three seconds of the thing sitting still, fifteen of you doing something to it, fifteen of it responding all the way to the end, and ten of the honest bit, which is your measurement or the wire that was wrong the first time.

The line worth writing in the post: where the program actually lives once you pull the cable out.

Show your work has the five-line template, a worked example, and the three checks to make before anything goes public. Tag it #BozomaBuilds so all nine of yours sit together.