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

12345678910111213141516171819202122232425262728
  1. package adafruitPCA9685 // import "go.rls.moe/misc/adafruitPCA9685"
  2. import (
  3. "time"
  4. )
  5. func (p *PCA9685) WaitForOscillator() {
  6. time.Sleep(5 * time.Millisecond)
  7. }
  8. func (p *PCA9685) logDebug(msg ...interface{}) {
  9. if p.debugger == nil {
  10. return
  11. }
  12. p.debugger.Print(msg...)
  13. }
  14. func (p *PCA9685) writeBReg(register, data byte) error {
  15. return p.dev.WriteReg(register, []byte{data})
  16. }
  17. func (p *PCA9685) readBReg(register byte) (byte, error) {
  18. var b = make([]byte, 1)
  19. err := p.dev.ReadReg(register, b)
  20. if err != nil {
  21. return 0, err
  22. }
  23. return b[0], nil
  24. }