Optimising multiplexer connection

Hi ( newbee here )

I am trying to make a reflex board game, consisting of many illuminated pushbuttons, organised in modules ( 9 modules ), every module is consisted of 8 pushbuttons. Those modules are daisy chained og connected at the end to an arduino.
The LED part of the illuminated button i going through a 74hc595
The Button part of the illuminated button is going through a 74hc165
at the end i have 7 outputs going to the arduino.

My question is would it be better to connect hc165 and hc595 together so i only use 4 pins ? or is it better to let them be separat ?
Thanks

If you've got enough pins keep 'em separate so you don't have to mess around multiplexing on the pins.

2 Likes

I would connect them in prallel to the SPI interface so you can read buttons at the same time you write LEDs:

  digitalWrite(CS, LOW);
  for (int interface = 0; interface < 9; interface++)
  {
    buttons[interface] = SPI.transfer(LEDs[interface]);
  }
  digitalWrite(CS, HIGH);

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.