Page tree
Skip to end of metadata
Go to start of metadata

网关支持3路数字信号输入,3路数字信号输出。

DI数字输入

网关支持的3路数字信号输入,

丝印说明

外壳丝印GPIO序号
DI168
DI2118
DI35

导出GPIO功能,每次上电后仅操作一次。

echo 68 > /sys/class/gpio/export
echo 118 > /sys/class/gpio/export
echo 5 > /sys/class/gpio/export
 
echo in > /sys/class/gpio/gpio68/direction
echo in > /sys/class/gpio/gpio118/direction
echo in > /sys/class/gpio/gpio5/direction

读取GPIO的状态

cat /sys/class/gpio/gpio68/value
cat /sys/class/gpio/gpio118/value
cat /sys/class/gpio/gpio5/value

没有电压的时候value为1,外部有电压后value为0。


DO数字输出


外壳丝印GPIO序号
DO10
DO21
DO367


echo 0 > /sys/class/gpio/export
echo 1 > /sys/class/gpio/export
echo 67 > /sys/class/gpio/export

echo out > /sys/class/gpio/gpio0/direction
echo out > /sys/class/gpio/gpio1/direction
echo out > /sys/class/gpio/gpio67/direction

echo 0 > /sys/class/gpio/gpio0/value
echo 0 > /sys/class/gpio/gpio1/value
echo 0 > /sys/class/gpio/gpio67/value

echo 1 > /sys/class/gpio/gpio0/value
echo 1 > /sys/class/gpio/gpio1/value
echo 1 > /sys/class/gpio/gpio67/value
  • No labels
Write a comment…