Anyone reading this seeking to move the chip_select pin from 10 to 9 on the CAN_shield will need to modify the “#define SPICS” parameter in the “mpc_can_dfs.h” file located in the CAN_Shield/MCP2515_lib library folder.
You will then need to add the following code before SPI.begin and/or CAN.begin and the library will handle the rest:
pinMode(9, OUTPUT);
digitalWrite(9, HIGH); // Define IO state to a known level to make sure the MCP2515 is unselected before initiating both SPI and CAN.
CAN.begin(SOME_BAUD_RATE);
// The rest of the magic stuff