mirror of
https://github.com/kidoman/embd
synced 2025-01-03 02:21:36 +01:00
doc: pwm
This commit is contained in:
parent
14b078a43e
commit
e6854c3726
12
README.md
12
README.md
@ -42,6 +42,18 @@ Even shorter while prototyping:
|
|||||||
...
|
...
|
||||||
embd.ToggleLED(3)
|
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.
|
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:
|
Control **GPIO** pins on the RaspberryPi / BeagleBone Black:
|
||||||
|
12
doc.go
12
doc.go
@ -25,6 +25,18 @@
|
|||||||
...
|
...
|
||||||
embd.ToggleLED(3)
|
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:
|
Control GPIO pins on the RaspberryPi / BeagleBone Black:
|
||||||
|
|
||||||
import "github.com/kidoman/embd"
|
import "github.com/kidoman/embd"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user