You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
472 B
Go

2 years ago
package device
// do sensor and methods
import (
"sync"
)
type PWMManager struct {
// do sensor manager
*ControllerManager
sync.RWMutex
Frequency int
DutyCycle int
}
func NewPWMManager() *PWMManager {
cm := NewControllerManager()
return &PWMManager{ControllerManager: cm}
}
// freq changing
func (m *PWMManager) GetFrequency() (int, error) {
m.Lock()
defer m.Unlock()
return m.Frequency, nil
}
func (m *PWMManager) String() string {
// TODO
return ""
}