mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 14:03:39 +00:00
72acda22b0
This commit refactors PWM support in the machine package to be more flexible. The new API can be used to produce tones at a specific frequency and control servos in a portable way, by abstracting over counter widths and prescalers.
12 lines
123 B
Go
12 lines
123 B
Go
// +build itsybitsy_m0
|
|
|
|
package main
|
|
|
|
import "machine"
|
|
|
|
var (
|
|
pwm = machine.TCC0
|
|
pinA = machine.D3
|
|
pinB = machine.D4
|
|
)
|