Adding comments to a sequence can help you organise it and document how it works. If you are returning to a sequence after a long time away from it, or are using someone else’s sequence, reading the comments can be immensely helpful.
You can add a comment to a line by starting it with two hyphens ( -- ):
-- This line is a comment
Everything on the line after the hyphens is ignored, so you can write whatever you like.
A quick way to add the hyphens to the line that your cursor is on, or to multiple lines that are selected, is to press Ctrl + -. You can remove the hyphens this way too.
Here are a few ways that you can use comments:
-- LED Flasher
-- Version 1, January 2016
-- By Tim Surtell
--
-- Flashes an LED connected to pin 2
-- Flash the Status LED twice
Light Status
Wait 0.5 Seconds
Light Status Black
Wait 0.5 Seconds
Light Status
Wait 0.5 Seconds
Light Status Black
Light Status
-- Wait 0.5 Seconds
Wait 1 Second