Skip to content

Instantly share code, notes, and snippets.

@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:
/*
* Example based on code found here.
* https://github.com/iwanders/OBD9141
*
* Put the "OBD9141 in Libraries folder.
*
*/
#include "OBD9141.h"
@rocketjosh
rocketjosh / OBD9141_DUE.INO
Last active October 27, 2017 01:34
OBD9141_DUE.INO
/*
* Example based on code found here.
* https://github.com/iwanders/OBD9141
*
* Put the "OBD9141 in Libraries folder.
*
*/
#include "OBD9141.h"
#include "SamNonDuePin.h"
@rocketjosh
rocketjosh / history.md
Last active March 7, 2017 01:18 — forked from morganrallen/history.md
Macchina M2-B Hacking Notes

cli history

miniterm.py `udevserial -v ID_MODEL=Arduino_Due -v SUBSYSTEM=tty` 115200 --raw
esptool32 --port `udevserial -v ID_MODEL=Arduino_Due -v SUBSYSTEM=tty` --before no_reset --after no_reset --baud 115200 write_flash 0x10000 ~/devel/ESP32/esp-idf/examples/bluetooth/gatt_server/build/gatt_server_demos.bin
// read the CCID
fona.getSIMCCID(replybuffer); // make sure replybuffer is at least 21 bytes!
Serial.print(F("SIM CCID = "));
Serial.println(replybuffer);
break;
}
case 'i':
{
// read the RSSI
uint8_t readline(char *buff, uint8_t maxbuff, uint16_t timeout) {
uint16_t buffidx = 0;
boolean timeoutvalid = true;
if (timeout == 0) timeoutvalid = false;
while (true) {
if (buffidx > maxbuff) {
//Serial.println(F("SPACE"));
break;
}
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13; // <--- CHANGE THIS LED PIN TO 81 or 82 FOR LED2 or LED3 ON MACCHINA