From e6854c3726b888ebf26a5fc5a66103a24849c7f9 Mon Sep 17 00:00:00 2001 From: Kunal Powar Date: Fri, 28 Mar 2014 08:39:36 +0530 Subject: [PATCH] doc: pwm --- README.md | 12 ++++++++++++ doc.go | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/README.md b/README.md index 51f3d6b..766f6e5 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,18 @@ Even shorter while prototyping: ... embd.ToggleLED(3) +BBB + **PWM**: + + import "github.com/kidoman/embd" + ... + embd.InitGPIO() + defer embd.CloseGPIO() + ... + pwm, _ := embd.NewPWMPin("P9_14") + defer pwm.Close() + ... + pwm.SetDuty(1000) + NB: **3** == **USR3** for all intents and purposes. The driver is smart enough to figure all this out. Control **GPIO** pins on the RaspberryPi / BeagleBone Black: diff --git a/doc.go b/doc.go index ac13d1d..01fbaf4 100644 --- a/doc.go +++ b/doc.go @@ -25,6 +25,18 @@ ... embd.ToggleLED(3) + BBB + **PWM**: + + import "github.com/kidoman/embd" + ... + embd.InitGPIO() + defer embd.CloseGPIO() + ... + pwm, _ := embd.NewPWMPin("P9_14") + defer pwm.Close() + ... + pwm.SetDuty(1000) + Control GPIO pins on the RaspberryPi / BeagleBone Black: import "github.com/kidoman/embd"