EasyManua.ls Logo

Adafruit Feather M4 Express - Interacting with the Serial Console

Adafruit Feather M4 Express
178 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Interacting with the Serial Console
Once you've successfully connected to the serial console, it's time to start using it.
The code you wrote earlier has no output to the serial console. So, we're going to edit it to create some output.
Open your code.py file into your editor, and include a print statement. You can print anything you like! Just include
your phrase between the quotation marks inside the parentheses. For example:
Save your file.
Now, let's go take a look at the window with our connection to the serial console.
Excellent! Our print statement is showing up in our console! Try changing the printed text to something else.
Keep your serial console window where you can see it. Save your file. You'll see what the serial console displays when
import board
import digitalio
import time
led = digitalio.DigitalInOut(board.D13)
led.direction = digitalio.Direction.OUTPUT
while True:
print("Hello, CircuitPython!")
led.value = True
time.sleep(1)
led.value = False
time.sleep(1)
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51 Page 56 of 183

Table of Contents

Related product manuals