This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Blink | |
Turns on an LED on for one second, then off for one second, repeatedly. | |
Most Arduinos have an on-board LED you can control. On the Uno and | |
Leonardo, it is attached to digital pin 13. If you're unsure what | |
pin the on-board LED is connected to on your Arduino model, check | |
the documentation at http://arduino.cc | |
This example code is in the public domain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################## | |
macchina.name=Macchina | |
macchina.vid.0=0x2341 | |
macchina.pid.0=0x003f | |
macchina.vid.1=0x2341 | |
macchina.pid.1=0x0044 | |
macchina.upload.tool=avrdude |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
byte i=0; | |
// CAN message frame (actually just the parts that are exposed by the MCP2515 RX/TX buffers) | |
Frame message; | |
void loop() { | |
message.id = 0; | |
// This implementation utilizes the MCP2515 INT pin to flag received messages or other events |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> // Arduino SPI Library | |
#include <MCP2515.h> | |
// Pin definitions specific to how the MCP2515 is wired up. | |
#define CS_PIN 85 | |
#define RESET_PIN 7 | |
#define INT_PIN 84 | |
// Create CAN object with pins as defined | |
MCP2515 CAN(CS_PIN, RESET_PIN, INT_PIN); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
MCP2515 CAN Interface Using SPI | |
Author: David Harding | |
Created: 11/08/2010 | |
Modified: 6/26/12 by RechargeCar Inc. | |
For further information see: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct | |
{ | |
unsigned long id; // EID if ide set, SID otherwise | |
byte srr; // Standard Frame Remote Transmit Request | |
byte rtr; // Remote Transmission Request | |
byte ide; // Extended ID flag | |
byte dlc; // Number of data bytes | |
byte data[8]; // Data bytes | |
} Frame; |