Band 5 · Simon Says
Practice Morse code
Send a message somebody else can actually read. The test is not that it beeps; it is that a person holding the chart can write down what you sent.
Sketches for this project
Every file opens with a plain-English header saying what it does and how to wire it, hole by hole.
Send a message somebody else can read
Make the buzzer, or a light, send SOS. Then make it send your own initials.
The test is not that it beeps. The test is that somebody holding the chart, who has not seen your code, can write down what you sent.
Why this is the right place to practise writing your own functions
Morse is two things repeated: a dot and a dash. You will type them dozens of times. Anything you are about to type dozens of times is a function waiting to be written, and this is the smallest, clearest example of that in the whole course.
Band 5 Part 5 showed you how. This page does not show you again.
The timing is the whole specification
10 minMorse is not “short beep, long beep”. It is a set of exact ratios, and if you get them wrong nobody can read it, which is the only test that matters.
| Thing | How long |
|---|---|
| A dot | 1 |
| A dash | 3 |
| Gap between the parts of one letter | 1 |
| Gap between two letters | 3 |
| Gap between two words | 7 |
Pick what 1 is worth in thousandths of a second, and everything else follows. Two hundred is a good place to start. Then a dot is 200, a dash is 600, and a letter gap is 600.
The letters you need for SOS: S is three dots. O is three dashes.
Build it, then hand it to somebody
25 minWhichever you pick, the rail needs two wires on it: the part's, and one from that same rail to a GND pin. And the two bands do not use the same rail. Band 1's light works on the top − rail, nearest row
j; Band 5's buzzer works on the bottom one, nearest row a. The two strips are not joined to each other, so follow whichever build you chose all the way down, and put the GND wire on the strip your part is actually using.tone and noTone, and Band 5 Part 4's bare wiring is right. If yours is active, digitalWrite is enough — but put a 220 ohm resistor in its pin leg, as Band 3 does, because an active buzzer pulls about thirty thousandths of an amp and a pin is built for twenty.Not sure which you have? Fit the resistor. It costs a little volume and nothing else.
The shape, if you are stuck
void dot() { /* on for one unit, off for one unit */ }
void dash() { /* on for three units, off for one unit */ }
void letterGap() { /* silence, and how long? */ }
Notice that dot and dash each end with their own gap built in. That is a decision, not the only way, and it makes the letter gap shorter than you might expect. Work out by how much.
Two ways further
- Bronze
- Send a whole word, with the seven-unit word gap in it, and have a second person read it back. Then halve your unit and see at what speed they stop being able to.
- Silver
- Go the other way: a button you tap, and the serial monitor prints a dot for a short press and a dash for a long one. You will have to decide where short stops and long starts, and then measure your own tapping to choose it. That is Band 4's calibration lesson arriving in a place nobody expects it. (You need
millisto time a press, so come back to this one after Band 5 Part 7. You will also need a button and its wiring from Band 3 Part 3.)
Keep
- Your chosen unit length, and what a dash and each gap came out as
- What your reader wrote down, next to what you actually sent
- Your functions, and one sentence on what you would have typed without them
Ship it
This one is yours. Nobody handed you a sketch for it, so the code in your video is code you wrote. Say that in the post, because it is the difference between somebody who can follow a tutorial and somebody who can build a thing, and it is the difference an employer is looking for.
The four shots as usual, and make the fourth one count: the check this page asked you to run, or the version that did not work first. Put a line of your own code on screen for three seconds. Almost nobody does, and it is the most convincing three seconds in the video.
Show your work has the template. Tag it #BozomaBuilds.