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
//Modified: 8/26/20 by Kenny-Macchina | |
/* | |
MCP2515 CAN Interface Using SPI | |
Author: David Harding | |
Created: 11/08/2010 | |
Modified: 6/26/12 by RechargeCar Inc. | |
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
//Modified: 8/26/20 by Kenny-Macchina | |
/* | |
MCP2515 CAN Interface Using SPI | |
Author: David Harding | |
Created: 11/08/2010 | |
Modified: 6/26/12 by RechargeCar Inc. | |
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 LLC | |
//Collin Kidder | |
//Queries over the CAN bus to see if anything responds to a VIN number request | |
#include <Arduino_Due_SD_HSMCI.h> | |
#include "Arduino.h" | |
#include <M2_12VIO.h> | |
#include <due_can.h> | |
#include <iso-tp.h> |
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
import can | |
from can.interface import Bus | |
from can import Message | |
import os | |
from datetime import datetime | |
from datetime import time | |
import csv | |
os.system('sudo ip link set can0 down') | |
os.system('sudo ip link set can0 up type can bitrate 500000') |
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 <esp32_can.h> | |
uint8_t codes[4] = {5, 0xB, 0xC, 0xD}; | |
int idx = 0; | |
uint32_t tick = 0; | |
const int led_pin = 13; | |
char msg_buf[10]; | |
int led_state = 0; |
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 "esp32_can.h" | |
void setup() | |
{ | |
Serial.begin(115200); | |
CAN0.setCANPins((gpio_num_t)4,(gpio_num_t)5); | |
Serial.println("Initializing ..."); | |
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
// Required libraries | |
#include "variant.h" | |
#include <due_can.h> | |
//Leave defined if you use native port, comment if using programming port | |
#define Serial SerialUSB | |
void setup() | |
{ | |
Serial.begin(115200); |