1
0
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:
Trevor Rosen 2019-01-29 16:56:17 -06:00 committed by GitHub
commit 2255be2695
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}