# Help understanding SPI and Arduino

I Have started making my 1st PCB, as per my other question (Located Here) and have been looking at the datasheet for the MAX7219CNG and studying the library to run it on an Arduino (Located Here)

Now my question is from what I can see in the library, there is a method called spiTransfer that sends the data to the IC to turn on and off the various LEDs. This is done by shifting data containing opcode and data bits. The opcodes are at the top of the .cpp file. For example #define OP_SHUTDOWN 12

I can't find where the related information is in the datasheet to say that 12 = Shutdown.

Am i reading the datasheet wrong or understanding the library wrong. I want to learn how to read a datasheet and implement code to run an IC with out relying on code written by others.

And guidance would be great thanks

That's because it's in the datasheet in hex. :-) Page 7, table 2. I'd have written the define as #define OP_SHUTDOWN 0x0C to be consistent with the datasheet…