Using the following code, print the line “HELLO, WORLD!” into the serial port once, print an empty line, and lastly, print the names of the members in your group repeatedly. No wiring of electrical components is necessary in this challenge. You are simply going to connect the Metro board to the computer.
1 Metro M0 Express
You must open the serial monitor to view the output of your board. The serial monitor is useful for printing out text and debugging your programs. Additionally, if you have errors in your code, the serial monitor will print these errors.
Open the Command Palette by navigating to View > Command Palette (or pressing Ctrl+Shift+P / Cmd+Shift+P on your keyboard).
Type CircuitPython to filter the commands.
Select CircuitPython: Open Serial Monitor from the dropdown list.
Save code to run the cod
Once your serial monitor is open, enter your code into the code.py file. To run your code, you must save the file. CircuitPython automatically detects when changes are saved and will immediately restart the board to execute the new instructions.
Save your file by navigating to File > Save or by pressing Ctrl+S (Windows) / Cmd+S (Mac).
Watch the serial monitor panel at the bottom of your screen to see your live output or any potential errors.
When you write code in VS Code and save it to the CIRCUITPY drive, the code is executing entirely on the Metro M0 Express microcontroller, not on your computer. Your computer and VS Code are only acting as a text editor and a monitor to view the board's serial output. Because the code runs on the board, it has direct access to the hardware pins, sensors, and electrical components you will connect in later challenges.
import time
print("__________\n")
while True:
__________
__________
time.sleep(1)
Note: \n means newline.
import time
print("Hello, World!\n")
while True:
print("Farnia")
print("Katie")
time.sleep(1)