thanks for reply..
I have been 'looking' at the datasheet.. but it has really 'clicked' yet..
sorry the pinout stuff was copy/pasted from my other attempt that uses the LedControl library and follows the pinout of these tutorials:
http://arduino.cc/playground/Main/MAX72XXHardware
&
http://arduino.cc/playground/Main/LedControl
I guess the wiring is different when wanting to use the SPI protocol?
I changed things out.. and tried to run this code.. it compiles.. ut does nothing..
(I am expecting a jerky fade in led intensity/brightness)
#include <SPI.h>
/*
pin D13 is connected to the DataIn (MAX7221 pin:1)
pin D11 is connected to the CLK (MAX7221 pin:13)
pin D10 is connected to LOAD (MAX7221 pin:12)
*/
// define the variables, #defines here, etc.
#define DECODE_MODE 0x09 // write data 0xFF, Code B Decode for all digits << You will set this for No Decode mode instead
#define INTENSITY_ADDRESS 0x0A // 0x07 to start, half intensity. valid from 0x00 (min) to 0x0F (max)
#define SCANLIMIT_ADDRESS 0x0B // 0xFF, all 8 digits on
#define SHUTDOWN_ADDRESS 0x0C // 0x01, normal operation (0x01 = shutdown) - powers up in shutdown mode
#define DISPLAYTEST_ADDRESS 0x0F // 0x01 = all lights on full, 0x00 = normal ops
#define register1 0x01 // digit 0
#define register2 0x02 // digit 1
#define register3 0x03 // digit 2
#define register4 0x04 // digit 3
#define register5 0x05 // digit 4
#define register6 0x06 // digit 5
#define register7 0x07 // digit 6
#define register8 0x08 // digit 7
void setup() {
Serial.begin(9600);
Serial.println("--SET UP CHIP--");
pinMode (10, OUTPUT); // need this, I would do it as #define SS 10, and then just use SS tho
SPI.begin(); // starts the SPI library
digitalWrite (10,LOW);
SPI.transfer (INTENSITY_ADDRESS); // you are correct 1 byte per transer
SPI.transfer (0x07); // for these lines
digitalWrite (10, HIGH);
}
void loop() {
digitalWrite (10,LOW);
SPI.transfer (INTENSITY_ADDRESS); // you are correct 1 byte per transer
SPI.transfer (0x07); // for these lines
digitalWrite (10, HIGH);
delay(500);
digitalWrite (10,LOW);
SPI.transfer (INTENSITY_ADDRESS); // you are correct 1 byte per transer
SPI.transfer (0x08); // for these lines
digitalWrite (10, HIGH);
delay(500);
digitalWrite (10,LOW);
SPI.transfer (INTENSITY_ADDRESS); // you are correct 1 byte per transer
SPI.transfer (0x09); // for these lines
digitalWrite (10, HIGH);
delay(500);
digitalWrite (10,LOW);
SPI.transfer (INTENSITY_ADDRESS); // you are correct 1 byte per transer
SPI.transfer (0x0A); // for these lines
digitalWrite (10, HIGH);
delay(500);
digitalWrite (10,LOW);
SPI.transfer (INTENSITY_ADDRESS); // you are correct 1 byte per transer
SPI.transfer (0x0B); // for these lines
digitalWrite (10, HIGH);
delay(500);
digitalWrite (10,LOW);
SPI.transfer (INTENSITY_ADDRESS); // you are correct 1 byte per transer
SPI.transfer (0x0C); // for these lines
digitalWrite (10, HIGH);
delay(500);
}
I have also updated the wiring as you suggested..