Conventions used
There are a number of text conventions used throughout this book.
Code in text
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “To run this code, be sure to send the pio_encoders.py
library, the updated robot.py
file, and then measure_fixed_time.py
.”
A block of code is set as follows:
import time import board import digitalio led = digitalio.DigitalInOut(board.LED) led.direction = digitalio.Direction.OUTPUT while True: led.value = True time.sleep(0.5) led.value = False time.sleep(0.5)
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
>>> print("Hello, world!") Hello, World! >>>
Any command-line input or output is written as follows:
code.py output: 4443 4522
Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Launch Mu Editor, and when it is running, click on the Mode button. From this, select CircuitPython.”
Tips or important notes
Appear like this.