Skip to content

Instantly share code, notes, and snippets.

this is a test of something
@rocketjosh
rocketjosh / Macchina_MPG.INO
Created November 3, 2017 17:08
Display MPG information with LED display and Macchina M2 with ISO9141-based vehicle
/*
* MPG LED display using Adafruit NeoPixel and Macchina M2 with a pre-CAN bus
* ISO9141 (K-line) based vehicle.
*
* These parts are used in this project:
*
* https://www.macchina.cc/content/m2-under-dash
* https://www.adafruit.com/product/2869
*
* Requires "Macchina M2" board to be installed and selected. For instructions, go here:
@rocketjosh
rocketjosh / M2VIN2SD.ino
Created May 6, 2020 18:35
Queries over the CAN bus to see if anything responds to a VIN number request
//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>
#include <FastLED.h>
#define LED_PIN 2
#define NUM_LEDS 1
#define BRIGHTNESS 64
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
#define UPDATES_PER_SECOND 100
#include <M2_12VIO.h>
M2_12VIO M2IO; //Constructor for the M2_12Vio library
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
void setup() {
M2IO.Init_12VIO(); // Initialise the M2I/O library
/*
9141 UART test - M2
*/
void setup() {
// initialize both serial ports:
SerialUSB.begin(9600);
Serial1.begin(9600);
/*
9141 UART test - ESP32 Dev board
*/
#define RXD2 22
#define TXD2 21
void setup() {
Serial.begin(9600);
Serial1.begin(9600, SERIAL_8N1, RXD2, TXD2);