Hardware introduction:
- BPI:bit(ESP32)
- Direct insertion LED
IO in computer refers to Input/Output, that is, input and output, referred to as IO port.
Hardware correlation function of IO port pin Modular.Before calling related functions, you need to import the corresponding libraries.
pin1.is_touched()
:
For example:
if pin1.is_touched():
Execution statement 1
Determine whether the pin on label 1 is touched or not, and execute statement 1 if touched.
pin2.write_digital()
:
For example:pin2.write_digital(1)
Pin Output High Level in Label 2; pin2.write_digital(0)
Output low level at label pin 2.