Skip to content

Instantly share code, notes, and snippets.

Avatar

Josh rocketjosh

View GitHub Profile
View PWM_pin_2.INO
#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
View ColorPallette.ino
#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
@rocketjosh
rocketjosh / M2VIN2SD.ino
Created May 6, 2020
Queries over the CAN bus to see if anything responds to a VIN number request
View M2VIN2SD.ino
//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>
View test.bin
this is a test of something
View PB RX log
debian@beaglebone:~$ candump -cae can2,0:0,#FFFFFFFF
can2 0F3 [8] 5F AA F9 7B DC 23 71 F3 '_..{.#q.'
can2 633 [8] remote request
can2 0F3 [8] 1F CF 0F CF 25 EF EB CE '....%...'
can2 20000004 [8] 00 01 00 00 00 00 00 00 ERRORFRAME
controller-problem{rx-overflow}
can2 0F3 [8] 5F AA F9 7B DC 23 71 F3 '_..{.#q.'
can2 0F3 [8] 1F CF 0F CF 25 EF EB CE '....%...'
can2 0F3 [8] 5F AA F9 7B DC 23 71 F3 '_..{.#q.'
can2 633 [8] remote request
View M2 RX log
ID: 100FFEE
Extended: Yes
Length: 6
23 FE 1D 7A 1D 7A
ID: 340
Extended: No
Length: 4
23 FE 1D 7A
View A0 basic test code (ESP32)
//Modified from this library to blink LED:
//https://github.com/miwagner/ESP32-Arduino-CAN
//
//Follow these instructions to install ESP32 board files:
//https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/boards_manager.md
#include <ESP32CAN.h>
#include <CAN_config.h>
CAN_device_t CAN_cfg; // CAN Config
View gist:f3180682a2aab05fe39d89ee5f0bf76e
debian@beaglebone:/opt/source/bb.org-overlays/src/arm$ ls
ACME-revB.dts BB-I2C2-RTC-DS1338.dts cape-univ-emmc-00A0.dts
AM335X-20-00A0.dts BBIM-00A0.dts cape-universal-00A0.dts
AM335X-I2C1-400-00A0.dts bb-justboom-amp-00A0.dts cape-universala-00A0.dts
AM335X-I2C2-400-00A0.dts bb-justboom-dac-00A0.dts cape-universalh-00A0.dts
AM335X-PRU-RPROC-4-14-TI-00A0.dts bb-justboom-digi-00A0.dts cape-universaln-00A0.dts
AM335X-PRU-RPROC-4-14-TI-PRUCAPE-00A0.dts BB-LCD-ADAFRUIT-18-SPI1-00A0.dts cape-univ-hdmi-00A0.dts
AM335X-PRU-RPROC-4-19-TI-00A0.dts BB-mBC1-ETH-CLICK.dts dev-USB-PWR-CTL-00A1.dts
AM335X-PRU-RPROC-4-19-TI-PRUCAPE-00A0.dts BB-mBC1-ETH-WIZ-CLICK.dts DLPDLCR2000-00A0.dts
AM335X-PRU-RPROC-4-4-TI-00A0.dts BB-mBC1-RTC-5-CLICK.dts DVK530-LCD4-01-00A0.dts
@rocketjosh
rocketjosh / Macchina_MPG.INO
Created Nov 3, 2017
Display MPG information with LED display and Macchina M2 with ISO9141-based vehicle
View Macchina_MPG.INO
/*
* 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:
View OBD9141_M2.INO
/*
* Example based on code found here.
* https://github.com/iwanders/OBD9141
*
* Put the "OBD9141 in Libraries folder.
*
*/
#include "OBD9141.h"