node pi gpio
Raspberry Pi的GPIO包装器安装$ npm install -S node-pi-gpio用法L chika $ npm run example:l_chika GPIO = require 'node-pi-gpio' pin = 24 time = 500 _loop = (gpio, val)-> gpio.valueval setTimeout _loop, time, gpio, (unless val then 1 else 0) GPIO.open pin, 'out' .then (gpio)-> process.on 'SIGINT', -> gpio.value 0 gpio.close() .then -> process.exit() _loop(gpio, 1) retur
用户评论