Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions examples/CAN_SpeedTest/CAN_SpeedTest.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ unsigned long oldTime = 0;

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

mcp2515.reset();
mcp2515.setBitrate(CAN_125KBPS);
Expand All @@ -19,7 +18,6 @@ void setup() {
}

void loop() {

if (mcp2515.readMessage(&canMsg) == MCP2515::ERROR_OK) {
cntr++;
}
Expand All @@ -30,5 +28,4 @@ void loop() {
Serial.println(" msg/sec");
cntr = 0;
}

}
6 changes: 0 additions & 6 deletions examples/CAN_read/CAN_read.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ MCP2515 mcp2515(10);

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

mcp2515.reset();
mcp2515.setBitrate(CAN_125KBPS);
Expand All @@ -18,22 +17,17 @@ void setup() {
}

void loop() {

if (mcp2515.readMessage(&canMsg) == MCP2515::ERROR_OK) {

Serial.print(canMsg.can_id, HEX); // print ID
Serial.print(" ");
Serial.print(canMsg.can_dlc, HEX); // print DLC
Serial.print(" ");

for (int i = 0; i<canMsg.can_dlc; i++) { // print the data

Serial.print(canMsg.data[i],HEX);
Serial.print(" ");

}

Serial.println();
}

}
4 changes: 0 additions & 4 deletions examples/CAN_write/CAN_write.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ MCP2515 mcp2515(10);


void setup() {

canMsg1.can_id = 0x0F6;
canMsg1.can_dlc = 8;
canMsg1.data[0] = 0x8E;
Expand All @@ -32,7 +31,6 @@ void setup() {

while (!Serial);
Serial.begin(115200);
SPI.begin();

mcp2515.reset();
mcp2515.setBitrate(CAN_125KBPS);
Expand All @@ -42,12 +40,10 @@ void setup() {
}

void loop() {

mcp2515.sendMessage(&canMsg1);
mcp2515.sendMessage(&canMsg2);

Serial.println("Messages sent");

delay(100);

}