Today i can send canbus from one canbus shield to another but I want the receiver to compare the received data with a master.
Why???
My project:
I will test some different canbus cables and thats because i want to send canbus for maybe 12Hours and then see if any of the package has been broken!
how much data are you planning to compare?
how is the master data stored? SD card?
would it be simpler to use a USB-Canbus dongle on a PC and compare with data stored on the PC?
I think it's enough with one data pack that repeats itself. And in the receiver, compare the package and have a counter that indicates if there is a diff.
I think its a very easy program but i didnt get the function...
Sorry, the program are on my computer on my work....
But i use the seeed-studio program send/receive.
The problem is to get the "canbusstring" into one string that i can compare with.
Now i get 8 small string.... ( buf)
How can i do to the 8 (BUF) to be only one!
Hope you get it!
#include <SPI.h> #include "mcp_can.h"
// the cs pin of the version after v1.1 is default to D9
// v0.9b and v1.0 is default D10
const int SPI_CS_PIN = 9;
MCP_CAN CAN(SPI_CS_PIN); // Set CS pin
void setup()
{
Serial.begin(115200);
while (CAN_OK != CAN.begin(CAN_500KBPS)) // init can bus : baudrate = 500k
{
Serial.println("CAN BUS Shield init fail");
Serial.println(" Init CAN BUS Shield again");
delay(100);
}
Serial.println("CAN BUS Shield init ok!");
}