diff --git a/platforms/firmata/firmata.go b/platforms/firmata/firmata.go index 60240214..556325eb 100644 --- a/platforms/firmata/firmata.go +++ b/platforms/firmata/firmata.go @@ -321,7 +321,7 @@ func (b *board) process(data []byte) { case AnalogMappingResponse: pinIndex := byte(0) - for _, val := range currentBuffer[2 : len(currentBuffer)-1] { + for _, val := range currentBuffer[2 : len(b.Pins)-1] { b.Pins[pinIndex].AnalogChannel = val