查看: 248|回复: 2

how to controll GPIO

[复制链接]

5

主题

12

帖子

69

积分

科员

Rank: 2

积分
69
发表于 2020-10-5 17:51:06 | 显示全部楼层 |阅读模式
本帖最后由 taniguchi 于 2020-10-5 18:27 编辑

#switch to rootsudo su -
#set GPIO to high
echo 1 > /sys/class/gpio/gpio339/vlaue
#set GPIO to low
echo 0 > /sys/class/gpio/gpio339/vlaue

I tried this command but it showed  Permission denied.How can I controll GPIO?


回复

使用道具 举报

5

主题

12

帖子

69

积分

科员

Rank: 2

积分
69
 楼主| 发表于 2020-10-8 14:16:52 | 显示全部楼层
I was able to control GPIOs by adding users to a privileged group.
On the other hand, setting the output of the DO to high does not allow current to flow. I would appreciate your solution.
回复

使用道具 举报

23

主题

48

帖子

536

积分

超级版主

Rank: 8Rank: 8

积分
536
发表于 2020-10-9 11:24:12 | 显示全部楼层
there is no GPIO 339, 339 is just a sample, please follow the instruction

GPIO Please change the code in <> to your GPIO export value #switch to root sudo su - #set GPIO to high echo 1 > /sys/class/gpio//vlaue #set GPIO to low echo 0 > /sys/class/gpio//vlaue For auto config, write above commands to file /etc/rc.local. UART Open device node in /dev/. Then use stty command to set parameters. See stty command manual for details, please change the code in <> to your UART device node. #config UART $ sudo stty -F /dev/ speed 115200 cs8 -parenb -cstopb -echo #send data...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点我注册

本版积分规则


快速回复 返回顶部 返回列表