rwaldron/johnny-five

Arduino Nano analog pins + shift register

merinsTDL opened this issue · 1 comments

Tested some board (DN22D08) which uses Arduino Nano + 2 shift registers (74HC595 to drive relays and 7 segment display.
http://johnny-five.io/examples/shift-register/
The board pin mapping uses Analog pins A2-A5 to drive the shift registers.

const register = new ShiftRegister({
    pins: {
      data: "A5",
      clock: "A3",
      latch: "A4",
    //   reset: "A2"
    }
  }); 

Type error as soon as I attempt to call functions on the register object (i.e. register.reset(), register.send(), register.display()).

TypeError: Cannot set properties of undefined (setting 'value') (firmata-io/lib/firmata.js:983:26)

It works with digital pin assignment but does not seem to support analog pins.

Found out the issue. The Shift register can accept pins mapped as strings i.e. "A1" but instead they work and should be only using D14-D19 as integers for the Analog pins of Nano board.