1 |
npm install pi-gpio |
如果运行提示gpio-admin相关问题 需要安装gpio-admin
1 2 |
npm update pi-gpio |
If the problem still exists, build the newest version of gpio-admin yourself.
Choose a directory you want to put gpio-admin in, and run
1 2 3 |
git clone https://github.com/quick2wire/quick2wire-gpio-admin.git cd quick2wire-gpio-admin |
If src/gpio-admin.c
has
1 2 |
int size = snprintf(path, PATH_MAX, "/sys/devices/virtual/gpio/gpio%u/%s", pin, filename); |
change it to
1 2 |
int size = snprintf(path, PATH_MAX, GPIO_CLASS_PATH "gpio%u/%s", pin, filename); |
Then, run make
Then, run
1 2 |
make install |