user14387: I'm hoping to get some help with this as I am unable to get the CAN to Initialize.
I have the sparkfun Can-Bus shield: https://www.sparkfun.com/products/13262
and an Arduino Leonardo board.
I'm using the following code to try to connect my 2008 Audi S6 to the Arduino board:
#include <Canbus.h>
#include <defaults.h>
#include <global.h>
#include <mcp2515.h>
#include <mcp2515_defs.h>
#include <Canbus.h>
char UserInput;
int data;
char buffer[456];  //Data will be temporarily stored to this buffer before being written to the file

//********************************Setup Loop*********************************//

void setup(){
Serial.begin(9600);
while(!Serial);
Serial.println("CAN-Bus Demo");

if(Canbus.init(CANSPEED_500))  /* Initialise MCP2515 CAN controller at the  specified speed */
  {
Serial.println("CAN Init ok");
  } else
  {
    Serial.println("Can't init CAN");
  } 

  delay(1000); 

Serial.println("Please choose a menu option.");
Serial.println("1.Speed");
Serial.println("2.RPM");
Serial.println("3.Throttle");
Serial.println("4.Coolant Temperature");
Serial.println("5.O2 Voltage");
Serial.println("6.MAF Sensor");

}



//********************************Main Loop*********************************//

void loop(){

while(Serial.available()){
   UserInput = Serial.read();

if (UserInput=='1'){
 data=Canbus.ecu_req(VEHICLE_SPEED, buffer);
 Serial.print("Vehicle Speed: ");
 Serial.print(data);
 Serial.println(" km/hr ");
 delay(1000);
}
else if (UserInput=='2'){
 data= Canbus.ecu_req(ENGINE_RPM, buffer);
 Serial.print("Engine RPM: ");
 Serial.print(data);
 Serial.println(" rpm ");
 delay(1000);

}
else if (UserInput=='3'){
 data= Canbus.ecu_req(THROTTLE, buffer);
 Serial.print("Throttle: ");
  Serial.print(data);
 Serial.println(" %% ");
 delay(1000);

}
else if (UserInput=='4'){
 data =Canbus.ecu_req(ENGINE_COOLANT_TEMP, buffer);
 Serial.print("Engine Coolant Temp: ");
 Serial.print(data);
 Serial.println(" degC");
 delay(1000);

}
else if (UserInput=='5'){
 data=Canbus.ecu_req(O2_VOLTAGE, buffer);
 Serial.print("O2 Voltage: ");
 Serial.print(data);
 Serial.println(" V");
 delay(1000);

}
else if (UserInput=='6'){
 data=Canbus.ecu_req(MAF_SENSOR, buffer);
 Serial.print("MAF Sensor: ");
 Serial.print(data);
 Serial.println(" g/s");
 delay(1000);

}
else
{
  Serial.println(UserInput);
  Serial.println("Not a valid input.");
  Serial.println("Please enter a valid option.");
}

}
}

Overall, I just can't get the CAN to initialize. I've looked online and just can't seem to find a solid solution. I've tried other libraries as well to no avail.
Please assist!

user28683: Had this problem myself. Found this fixed it
Change the following line...
_delay_us(10);

To...
_delay_us(50);

In the MCP2515.c file in the library

user69257: Increasing that delay in the MCP2515.c file also fixed this issue for me.
I am running the sparkfun Can-Bus shield on an Arduino pro-mini, and here is my serial monitor output before the change, and after:
12:56:38.580 -> CAN Read - Testing receival of CAN Bus message
12:56:39.556 -> Can't init CAN
13:01:40.992 -> CAN Read - Testing receival of CAN Bus message
13:01:42.016 -> CAN Init ok

14387: <p>I'm hoping to get some help with this as I am unable to get the CAN to Initialize.</p>

<p>I have the sparkfun Can-Bus shield: <a href="https://www.sparkfun.com/products/13262" rel="nofollow">https://www.sparkfun.com/products/13262</a></p>

<p>and an Arduino Leonardo board.</p>

<p>I'm using the following code to try to connect my 2008 Audi S6 to the Arduino board:</p>

<pre><code>#include &lt;Canbus.h&gt;
#include &lt;defaults.h&gt;
#include &lt;global.h&gt;
#include &lt;mcp2515.h&gt;
#include &lt;mcp2515_defs.h&gt;
#include &lt;Canbus.h&gt;
char UserInput;
int data;
char buffer[456];  //Data will be temporarily stored to this buffer before being written to the file

//********************************Setup Loop*********************************//

void setup(){
Serial.begin(9600);
while(!Serial);
Serial.println("CAN-Bus Demo");

if(Canbus.init(CANSPEED_500))  /* Initialise MCP2515 CAN controller at the  specified speed */
  {
Serial.println("CAN Init ok");
  } else
  {
    Serial.println("Can't init CAN");
  } 

  delay(1000); 

Serial.println("Please choose a menu option.");
Serial.println("1.Speed");
Serial.println("2.RPM");
Serial.println("3.Throttle");
Serial.println("4.Coolant Temperature");
Serial.println("5.O2 Voltage");
Serial.println("6.MAF Sensor");

}



//********************************Main Loop*********************************//

void loop(){

while(Serial.available()){
   UserInput = Serial.read();

if (UserInput=='1'){
 data=Canbus.ecu_req(VEHICLE_SPEED, buffer);
 Serial.print("Vehicle Speed: ");
 Serial.print(data);
 Serial.println(" km/hr ");
 delay(1000);
}
else if (UserInput=='2'){
 data= Canbus.ecu_req(ENGINE_RPM, buffer);
 Serial.print("Engine RPM: ");
 Serial.print(data);
 Serial.println(" rpm ");
 delay(1000);

}
else if (UserInput=='3'){
 data= Canbus.ecu_req(THROTTLE, buffer);
 Serial.print("Throttle: ");
  Serial.print(data);
 Serial.println(" %% ");
 delay(1000);

}
else if (UserInput=='4'){
 data =Canbus.ecu_req(ENGINE_COOLANT_TEMP, buffer);
 Serial.print("Engine Coolant Temp: ");
 Serial.print(data);
 Serial.println(" degC");
 delay(1000);

}
else if (UserInput=='5'){
 data=Canbus.ecu_req(O2_VOLTAGE, buffer);
 Serial.print("O2 Voltage: ");
 Serial.print(data);
 Serial.println(" V");
 delay(1000);

}
else if (UserInput=='6'){
 data=Canbus.ecu_req(MAF_SENSOR, buffer);
 Serial.print("MAF Sensor: ");
 Serial.print(data);
 Serial.println(" g/s");
 delay(1000);

}
else
{
  Serial.println(UserInput);
  Serial.println("Not a valid input.");
  Serial.println("Please enter a valid option.");
}

}
}
</code></pre>

<p>Overall, I just can't get the CAN to initialize. I've looked online and just can't seem to find a solid solution. I've tried other libraries as well to no avail.</p>

<p>Please assist!</p>
 28683: <p>Had this problem myself. Found this fixed it</p>

<p>Change the following line...</p>

<pre><code>_delay_us(10);
</code></pre>

<p>To...</p>

<pre><code>_delay_us(50);
</code></pre>

<p>In the <code>MCP2515.c</code> file in the library</p>
 69257: <p>Increasing that delay in the MCP2515.c file also fixed this issue for me.
I am running the sparkfun Can-Bus shield on an Arduino pro-mini, and here is my serial monitor output before the change, and after:</p>
<p>12:56:38.580 -&gt; CAN Read - Testing receival of CAN Bus message
12:56:39.556 -&gt; Can't init CAN
13:01:40.992 -&gt; CAN Read - Testing receival of CAN Bus message
13:01:42.016 -&gt; CAN Init ok</p>
