mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-15 04:13:40 +00:00
refactor: add display.Pin interface and use it everywhere that is easy to do so
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
committed by
Yurii Soldak
parent
d02d21ecea
commit
38c606d813
+4
-4
@@ -2,20 +2,20 @@
|
||||
package buzzer // import "tinygo.org/x/drivers/buzzer"
|
||||
|
||||
import (
|
||||
"machine"
|
||||
|
||||
"time"
|
||||
|
||||
"tinygo.org/x/drivers"
|
||||
)
|
||||
|
||||
// Device wraps a GPIO connection to a buzzer.
|
||||
type Device struct {
|
||||
pin machine.Pin
|
||||
pin drivers.Pin
|
||||
High bool
|
||||
BPM float64
|
||||
}
|
||||
|
||||
// New returns a new buzzer driver given which pin to use
|
||||
func New(pin machine.Pin) Device {
|
||||
func New(pin drivers.Pin) Device {
|
||||
return Device{
|
||||
pin: pin,
|
||||
High: false,
|
||||
|
||||
Reference in New Issue
Block a user