CAN Bus Shield (sparkfun + UNO)

Hello I’m trying to make connection between Arduino UNO and My Laptop computer.

here is what i use for it

I want to make Arduino send a message to Laptop through PCAN-USB.

I just want to check received message on my Laptop using PCAN View program.

I used following code


#include <mcp_can.h>
#include <SPI.h>

void setup()
{
Serial.begin(115200);
// init can bus, baudrate: 500k
if(CAN.begin(CAN_500KBPS) ==CAN_OK) Serial.print(“can init ok!!\r\n”);
else Serial.print(“Can init fail!!\r\n”);
}

unsigned char stmp[8] = {0, 1, 2, 3, 4, 5, 6, 7};
void loop()
{
// send data: id = 0x00, standrad flame, data len = 8, stmp: data buf
if(CAN.sendMsgBuf(0x00, 0, 8, stmp)==CAN_OK)
{
Serial.print(“Success OK\n”);
}
delay(100); // send data per 100ms
}


but It always failed to initialize. Could you tell me why it happened?
and tell me how to solve it as well.

Thanks for reading.