项目作者: chenqinghe

项目描述 :
a library to operate respberrypi gpio pins
高级语言: Go
项目地址: git://github.com/chenqinghe/raspberrypi-gpio.git
创建时间: 2017-09-24T02:21:50Z
项目社区:https://github.com/chenqinghe/raspberrypi-gpio

开源协议:MIT License

下载


raspberrypi-gpio 中文说明

this project is a library to operate raspberry pi gpio pins.

usage

example

here is a example to control led.

  1. ledpin := gpio.NewPin("led control", 4, gpio.OUT)
  2. //expose pin to user space
  3. if err := ledpin.Export(); err != nil {
  4. panic(err)
  5. }
  6. defer ledpin.Unexport()
  7. //light led
  8. if err := ledpin.Write(gpio.HIGH); err != nil {
  9. panic(err)
  10. }
  11. //twinkle
  12. if err := ledpin.Blink(time.Second, time.Second*10); err != nil {
  13. panic(err)
  14. }

license

this project is under MIT license.