Translations:Управление низковольтной нагрузкой/13/en

Материал из Wiren Board
  1. Find the GPIO number corresponding to the desired terminal in the tableWB2.8/WB3.5/WB4/WB5. For terminal strip number 2 in version 2.8, it is GPIO 32.
  2. Export GPIO to sysfs
    root@wirenboard:~# echo 32 > /sys/class/gpio/export
  3. Set the GPIO to output mode to control the transistor. This is required because GPIO can be in input mode and have a high impedance, leaving the transistor in an undefined state.
    root@wirenboard:~# echo out > /sys/class/gpio/gpio32/direction
  4. Open the transistor, giving a logical high level to the gate:
    root@wirenboard:~# echo 1 > /sys/class/gpio/gpio32/value
  5. Close the transistor, giving a logical zero to the gate:
    root@wirenboard:~# echo 0 > /sys/class/gpio/gpio32/value