function error for CAN

Hello

I am using a v1.0 SEEEDSTUDIO CANBUS Shield attached to a UNO R3

using IDE 1.0.5, I have uploaded the receive_check program which compiles and uploads correctly. I don't have any other device to read the CAN off at this stage.

When i try to upload the send program however, it will not compile. Nor will it compile in v1.0 of the IDE either.

The same message appears in both

"
// demo: CAN-BUS Shield, send data
#include <mcp_can.h>
#include <SPI.h>

MCP_CAN CAN(10); // Set CS to pin 10

void setup()
{
Serial.begin(115200);

START_INIT:

if(CAN_OK == CAN.begin(CAN_500KBPS)) // init can bus : baudrate = 500k
{
Serial.println("CAN BUS Shield init ok!");
}
else
{
Serial.println("CAN BUS Shield init fail");
Serial.println("Init CAN BUS Shield again");
delay(100);
goto START_INIT;
}
}

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
CAN.sendMsgBuf(0x00, 0, 8, stmp);
delay(100); // send data per 100ms"

The error I get is this:

send.cpp: In function 'void loop()':
send:29: error: no matching function for call to 'MCP_CAN::sendMsgBuf(int, int, int, unsigned char [8])'
/Users/MH/Documents/Arduino/libraries/CAN_BUS_Shield_master/mcp_can.h:102: note: candidates are: byte MCP_CAN::sendMsgBuf(long unsigned int, byte, byte, byte, byte*)

Now I'm new to Arduino & programming, but am I right in thinking the IDE is telling me that function sendMsgBuf, needs to have five elements rather than the usual four for a can signal?

In testing this, the sketch compiles if I add an additional digit, for example:

CAN.sendMsgBuf(0x00, 0, 8, 0, stmp);

This then uploads fine, but the TX & RX red lights are on solid, and the serial monitor doesn't display anything apart from INIT OK, although i guess thats expected as nothing is telling stmp to print to serial.

Could anyone help with why the TX & RX lights are on solid, and how I could test that this board is actually outputting any signals once per second, back to the serial monitor?

Thanks

[ please edit your posting to use code tags ]

Did you see the docs at: http://www.seeedstudio.com/wiki/CAN-BUS_Shield#5._Send_Data

Thanks for the reply

How do I use code tags?

in terms of the link you provided, as it says on there the sendMsgBuf command is made up of four parts, the ID, Frame state, length and message.

Arduino's IDE is asking me to provide five variables within the sendMsgBuf command. I have no idea what the fifth variable is, what its for or what its doing to the output.

djgynx:
Thanks for the reply

How do I use code tags?

Have you not bothered to read the "How to use this forum - please read" sticky-thread???

in terms of the link you provided, as it says on there the sendMsgBuf command is made up of four parts, the ID, Frame state, length and message.

Arduino's IDE is asking me to provide five variables within the sendMsgBuf command. I have no idea what the fifth variable is, what its for or what its doing to the output.

Whoops, I mis-counted. Anyway if you look at the source to mcp_can.h you can
see the real thing. You do read the .h files don't you? That's where useful
and correct documentation is to be found.

https://github.com/Seeed-Studio/CAN_BUS_Shield/blob/master/mcp_can.h

Apologies, I thought it was something you exported from the IDE, never thought to look at the browser.

I had scanned over the .h file, and whilst to be honest I've got no idea what 99% of it is! I did find the term however mine only had four terms (was provided on a flash drive with the shield).

Looking at the link you've provided it looks obvious, being the INT8U rtr term which is extra compared to mine., I'm guessing this is some form of a read receipt?

Tried setting the rtr to both 0 or 1.

Still getting solid LEDs for both TX and RX, no text (apart from the init ok) in the serial monitor.

Though I can confirm the voltage across CANH is greater than CANL so something is occurring on the bus

Tearing my hair out here lol