Hi, I found this in one of my sketch folders and made some quick changes to show you how to display text and numbers.
You will have to adapt for your display setup (Chip select pin and display count etc).
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Max72xxPanel.h>
int pinCS = A3; // Attach CS to this pin, DIN to MOSI and CLK to SCK (cf http://arduino.cc/en/Reference/SPI )
int numberOfHorizontalDisplays = 2;
int numberOfVerticalDisplays = 1;
Max72xxPanel matrix = Max72xxPanel(pinCS, numberOfHorizontalDisplays, numberOfVerticalDisplays);
int pinRandom = A0;
int wait = 1000; // In milliseconds
int number = 0;
int old_number = 0;
void setup() {
matrix.setIntensity(2); // Set brightness between 0 and 15
// Adjust to your own needs
// matrix.setPosition(0, 0, 0); // The first display is at <0, 0>
// matrix.setPosition(1, 1, 0); // The second display is at <1, 0>
// matrix.setPosition(2, 2, 0); // The third display is at <2, 0>
// matrix.setPosition(3, 3, 0); // And the last display is at <3, 0>
// ...
// matrix.setRotation(0, 2); // The first display is position upside down
// matrix.setRotation(3, 2); // The same hold for the last display
randomSeed(analogRead(pinRandom)); // Initialize random generator
}
void loop() {
while(number==old_number) number = random(10); // generate a different random number emulating a temperature
matrix.fillScreen(0); // Must clear pixels each time otherwise pixels are not switched OFF
matrix.setCursor(1,0); // Set cursor 1 pixel in from left and top pixel (y = 0)
matrix.print(number); // Print to bitmap array (virtual screen in memory)
matrix.write(); // Send bitmap array to the LED display (sets pixels ON), cursor will move on
matrix.print("C"); // Print C to bitmap array
matrix.write(); // Send bitmap array to the LED display (sets pixels ON)
old_number = number;
delay(wait);
}
Have a look at the Parola libraries at http://codeplex.parola.com. As long as you can create a string to display, the libraries will take care of managing the modules. There are examples to display data from a serial line to the matrix modules.
Worst case, you can steal some of the ideas in the code and implement your own.