Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/19/08 02:22
Read: times


 
#156026 - Is this a good approach using a 2D array for this?
I'm thinking a 2D array would work properly for a sub project I'm working on. But the more I think about it a single array makes more sense. I'm using a SP3T solid state CMOS switch with 2 bit control. I could literally hard code it for the functions I want to do, but after reading up on 2D arrays, it "seems" like that is the direction I'd want to go with it.

There is a dedicated micro lpc924 with 6 dedicated pins for this control scheme.

There are 3 of these devices where:

00 > no connection
01 > In1 to Out
10 > In2 to Out
11 > In3 to Out

So that would leave a control array that would look like:
Chip1  Chip2  Chip3 

00     00     00
01     01     01      
10     10     10
11     11     11


There are times where I'd want to mix and match which element gets sent to the control bits. I can put each chip into a single array each and just index the element and dump the bit values to the pins. Does a 2D array make any sense here?

Some of the scenerios could be like:

All NC
All In1 to out
chip 1/2 In2 > out chip 3 In3 > out

Or any one of the variations. I'll never use all the combinations, just a few specifics, most likely 14 different combinations of hand.

Just looking for a logical approach, does a 2D array make sense or does just coding into the local function to toggle the necessary pins. I can see the array in my head, but I read the multi dimensional arrays can be problematic with that amount of RAM required.

Thoughts?
Chris






List of 2 messages in thread
TopicAuthorDate
Is this a good approach using a 2D array for this?            01/01/70 00:00      
   maybe ok....            01/01/70 00:00      

Back to Subject List