(screen shots and patch below)
I am sharing a patch here on this forum that allows the user to control 2 x 4 shift registers.
( 64 outputs from 6 pins on an arduino ) it works , but it is not very efficient.
i am pretty good at max but terrible with arduino. therefore all the processing happens in max
and is output through maxuino serial and standard firmata. with no modifications to the standard firmata arduino sketch.
as you may know: To control a shift register you need to send a sequence of 1's and '0s and the shift register will then light up a selection of leds. So to create the sequence of 1's & 0's : in max I created 2 x step sequencers that generate the needed serial sequence to control the external 74hc595n shift registers on the breadboard, it's pretty crazy because it gobbles up the serial bandwidth and makes max a bit sluggish too.
In the time i had ,this is the only way I could get all these shift registers to be controlled from max and just as importantly still have control of the analogue inputs and remaining digital out pins.
There are some super efficient sketches available about the net that will allow all the processing to happen inside the arduino and therefore you only need to send a small amout of data via serial to the arduino to control a massive array of leds. But i could not figure out how to do this whilst keeping the "analog in" functionality in max , and so I had to resort to this inefficient patch .
so to whoever is reading ,if you are stuck, like i was, need control of lots of leds from max and do not know how to make complex sketches, here is a patch below that may help you get by. http://www.filedropper.com/2x4shiftregisters
here are a few screen shots
you can see how inefficient all this is, just by looking at it. lol . : )
here in this sub patcher is one of the step sequencers that controls 4 x shift registers.
the 3 outlets at the bottom of this sub patcher go to maxuino and then to the arduino
and then to the shift register.