2 x 4 shift registers, max (inefficient solution)

(screen shots and patch below)

hi there.

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.

peace: )

I just did the same recently, with just 2 shift registers and 1 ULN2803, to control up to 128 mulitplexed LEDs.
I kept the data of what was being displayed on the LEDs in an array, and shift it out to the shift registers every 500uS using SPI.transfer()'s.
Whenever serial data comesin, the array is updated between refresh cycles.

CrossRoads:
I just did the same recently, with just 2 shift registers and 1 ULN2803, to control up to 128 mulitplexed LEDs.
I kept the data of what was being displayed on the LEDs in an array, and shift it out to the shift registers every 500uS using SPI.transfer()'s.
Whenever serial data comesin, the array is updated between refresh cycles.

sounds very interesting. 128 leds, cool : )

i had a go with an ardunio tutorial a few weeks ago (below) which works more efficiently than mine above. all the user needs to send is an 8-bit number from max and the arduino does the rest of the work. The arduino analogue inputs are not enabled in the sketch provided however, which is why I decided to make my own patch.

little-scale.blogspot.co.uk/2008/01/talking-to-3-595s-via-maxmsp.html