NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » Multi Panel Array - 2 panels - what lines need to be changed

February 26, 2010
by gplouffe
gplouffe's Avatar

I am putting together a multi panel array and wondered what lines it the C code need to change?

In the slave file I assume these will need to be changed and I assume I can put two of the four columns back in play as I don't need to address the other two as in your video but I don't know what pins or pin assignments to use.

include "../libnerdkits/delay.h"

// PIN DEFINITIONS: // // PB1 - ROW 0 // PC0-3 - ROW 1-4 // PC4-6, PD0-7 COL 0-9

define ROWS 5

define COLS 20

In the Master file is this the only area that needs to change?

/ PIN DEFINITIONS: // // PB5 - SCK // PB3 - MOSI (Master Out Slave In) // PB1, PC0-2 SS pins for slave panels

define ROWS 5

define COLS_PER_ARRAY 20

define NUM_ARRAYS 1

define COLS (NUM_ARRAYS * COLS_PER_ARRAY)

Thanks! Guy

February 26, 2010
by hevans
(NerdKits Staff)

hevans's Avatar

Hi gplouffe,

If you add four spaces before all your code fragments, the forum system will know it is code and not think all your define statements deserve to be huge =).

You certainly have the right idea that those are the sections that need to be modified in the code. Those sections hold definitions that are used later in the code to determine how many columns and rows it is dealing with. I'm not sure how you intend to get two of the columns back on the slave arrays. If you take a look at the way the system works, the master is communicating directly with each of its slaves. So the SPI module is being used on every slave. Does that make sense?

Humberto

February 27, 2010
by gplouffe
gplouffe's Avatar

Thanks for the tip on the formatting. :)

I guess I thought that I could put two of the slave select lines back into service since I will not have those MCU's to talk to. Is this not correct?

Thanks Guy

March 01, 2010
by hevans
(NerdKits Staff)

hevans's Avatar

Hi Guy,

You do get two of the slave select lines back, but those are two pins on the master chip, which is not actually driving an LED array. The two chips that you still have that are running an LED Array still need the SS pin.

Humberto

Post a Reply

Please log in to post a reply.

Did you know that Pulse Width Modulation (PWM) can be used to control the speed of a motor digitally? Learn more...