0x0A is hexadecimal 0A = B00001010 = Decimal 10
"its all these: 0x01 all over.. (kind of overwhelming at first)..
these are hex values? (addresses) for the MAX chip..."
Yes they are, I recommend you look at the datasheet, their usage will become clear then.
#define INTENSITY_ADDRESS 0x0A
// #define assigns the value of 0x0A to the variablle INTENSITY_ADDRESS, and the code cannot change change it later.
// I used 0x0A as that is how the datashet uses them, makes for less mistakes
// anything after the slashes are comments, even when on the same line
I don't think you have these correct:
/*
-pin 12 is connected to the DataIn (MAX pin:1)
-pin 11 is connected to the CLK (MAX pin:13)
-pin 10 is connected to LOAD/CS/SS (MAX pin:12)
*/
Arduino D13 is SCK, this is the clock line -> to MAX7221 pin 13
Arduino D11 is the MOSI line (master out slave in), this the serial data out line -> to MAX7221 pin 1
Arduino D10 is the SS line -> to MAX7221 pin 12
(you can assign other Arduino pins as SS also - but D11-D12-D13 are SPI hardware pins)
Need changes in this section:
#include <SPI.h> // In the IDE, select Sketch:Import Library:SPI it will add this to the top of sketch
// define the variables, #defines here, etc.
void setup() {
Serial.begin(9600);
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
Serial.println("--SET UP CHIP--");
digitalWrite (10,LOW);
SPI.transfer (INTENSITY_ADDRESS); // you are correct 1 byte per transer
SPI.transfer ( 0x07); // for these lines
digitalWrite (10, HIGH);
}