code.py
 1  # SPDX-FileCopyrightText: 2022 Liz Clark for Adafruit Industries
 2  #
 3  # SPDX-License-Identifier: MIT
 4  
 5  import time
 6  import board
 7  from digitalio import DigitalInOut, Direction
 8  
 9  # motor output
10  solenoid = DigitalInOut(board.D5)
11  solenoid.direction = Direction.OUTPUT
12  
13  while True:
14      solenoid.value = False
15      print("The motor is not triggered.")
16      time.sleep(1)
17      solenoid.value = True
18      print("The motor is triggered.")
19      time.sleep(1)