mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-04-26 13:48:49 +08:00
Merge pull request #654 from chmorgan/dev
pwm_pin - Fix DutyCycle() parse error, need to trim off trailing '\n'…
This commit is contained in:
commit
2255be2695
@ -148,7 +148,8 @@ func (p *PWMPin) DutyCycle() (duty uint32, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
val, e := strconv.Atoi(string(buf))
|
||||
v := bytes.TrimRight(buf, "\n")
|
||||
val, e := strconv.Atoi(string(v))
|
||||
return uint32(val), e
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user