Rocket Morse Code: Part Five

Customize your Morse code messages in real time when you program one of your Code Rocket’s buttons to ‘beep’ the speaker when pressed!

Code

The code in the editor below already works. Just plug in your Code Rocket and press upload to see what it does! Tinker with it and make changes to see what each line of code controls.

Walkthrough Videos

Watch the videos for line-by-line explanation of how the example program works. Then you'll be ready to make some changes of your own!

Challenges

Can you complete the challenges? Change the code in the editor above, then upload it to your Code Rocket and see if you got the result. Don't stop here, keep experimenting with the code!

Concepts

These are the new code concepts covered in this example program. To become a great coder, read through these concepts to learn new vocabulary.

New Concept: Inputs to your code!

Most programs you use daily require some kind of input from you - a password for an account, or maybe a ‘time to cook’ on the microwave. Now you’re integrating inputs into your program and giving your code ‘choices’ about what to do based on the input it receives.

Quiz

If you're having trouble, try to run an experimental program or look at the example code to help you find the answer.

1. The two main parts of an 'if' statement, according to the code walkthrough video, are:




2. Can you have an 'if' statement without an 'else' statement?



3. Can you have an 'else' statement without an 'if' statement?