Tackle the big coding topic of variables and see how much easier they can make it to update the way your Morse code LED message works!
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.
New Concept: Variables replace fixed number values
By using variables throughout your loop in this project, you made it much easier to read the code now and modify it later. To speed up the message, you only need to change one value in the program and the rest of the program automatically updates. When you read the Morse code rules at the top of this program and then look at the lines where you created the variables, you can see how similar they are - you’re just turning the rules of Morse code into rules in your computer code!
If you wanted to write out a long Morse code message in computer code, your variables should also make that easier. Instead of having to constantly review the rules, you can type the variables more naturally.