Skip to content

Instantly share code, notes, and snippets.

Matt McMillan matt448

Block or report user

Report or block matt448

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@matt448
matt448 / Speedometer_7seg.ino
Created Feb 4, 2014
Code that controls my Arduino based digital speedometer. This version uses a seven segment LED display.
View Speedometer_7seg.ino
// Matthew McMillan
// @matthewmcmillan
// http://matthewcmcmillan.blogspot.com
//
// Digital speedometer
//
// VSS on car connects to pin 5
// CLK on display to Analog pin 5
// DAT on display to Analog pin 4
//
@matt448
matt448 / MCP4251_tcon.ino
Last active Aug 29, 2015
Example code for controlling a MCP4251 with an Arduino Uno.
View MCP4251_tcon.ino
/*
Matthew McMillan
@matthewmcmillan
http://matthewcmcmillan.blogspot.com
Created 12 Mar 2014
Digital Pot Control (MCP4251)
@matt448
matt448 / tft_speedo_with_sd_card.ino
Last active Aug 29, 2015
This code is a work in progress for my TFT speedometer project.
View tft_speedo_with_sd_card.ino
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9340.h"
#include <SD.h>
#if defined(__SAM3X8E__)
#undef __FlashStringHelper::F(string_literal)
#define F(string_literal) string_literal
#endif
View part1_BBB_TFT_fonts.py
import Image
import ImageDraw
import ImageFont
import Adafruit_ILI9341 as TFT
import Adafruit_GPIO as GPIO
import Adafruit_GPIO.SPI as SPI
font = ImageFont.truetype('Minecraftia.ttf', 16)
@matt448
matt448 / canbus_start.sh
Created Oct 19, 2014
Script to start can bus interface on a Beagle Bone Black
View canbus_start.sh
#!/bin/bash
re='^[0-9]+$'
if ! [[ $1 =~ $re ]] ; then
echo -e "ERROR: Can bus bitrate not a number or a value wasn't entered.\n\nPlease enter a speed in Kbit/s\n\n Example: canbus_start.sh 100\n Speeds: 100,125,250,500\n" >&2; exit 1
fi
echo Bitrate: ${1}Kbit/s
sudo modprobe can
sudo modprobe can-dev
@matt448
matt448 / dcan1_dmesg_output.txt
Created Oct 19, 2014
Output from dmesg when enabling dcan1 on a Beagle Bone Black
View dcan1_dmesg_output.txt
root@bone:~# dmesg | tail -n 15
[1190326.609897] gadget: high-speed config #1: Multifunction with RNDIS
[1199448.966162] bone-capemgr bone_capemgr.9: part_number 'BB-DCAN1', version 'N/A'
[1199448.966337] bone-capemgr bone_capemgr.9: slot #9: generic override
[1199448.966382] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 9
[1199448.966430] bone-capemgr bone_capemgr.9: slot #9: 'Override Board Name,00A0,Override Manuf,BB-DCAN1'
[1199448.968166] bone-capemgr bone_capemgr.9: slot #9: Requesting part number/version based 'BB-DCAN1-00A0.dtbo
[1199448.968223] bone-capemgr bone_capemgr.9: slot #9: Requesting firmware 'BB-DCAN1-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[1199448.969684] bone-capemgr bone_capemgr.9: slot #9: dtbo 'BB-DCAN1-00A0.dtbo' loaded; converting to live tree
[1199448.970118] bone-capemgr bone_capemgr.9: slot #9: #2 overlays
@matt448
matt448 / BB-DCAN1-00A0.dts
Last active Aug 29, 2015
Device tree overlay to enable dcan1 on a Beagle Bone Black
View BB-DCAN1-00A0.dts
/dts-v1/;
/plugin/;
/ {
compatible = "ti,beaglebone", "ti,beaglebone-black";
/* identification */
part-number = "dcan1pinmux";
fragment@0 {
@matt448
matt448 / trinket_can_to_uart.ino
Last active Aug 29, 2015
A CAN Bus to Uart Converter using an Adafruit Pro Trinket, MCP2515 and a MCP2562.
View trinket_can_to_uart.ino
////////////////////////////////////////////
//
// Trinket Pro CAN Bus to UART Converter
//
// https://matthewcmcmillan.blogspot.com
// Twitter: @matthewmcmillan
//
// For the most up to date version of this file see:
// https://github.com/matt448/Digital_Dash_v2/blob/master/arduino_code/trinket_can_to_uart.ino
//
@matt448
matt448 / serialtest.py
Last active Aug 29, 2015
Python script to test the CAN data sent by the Trinket CAN to UART converter
View serialtest.py
#!/usr/bin/python
##########################################
# https://matthewcmcmillan.blogspot.com
# Twitter: @matthewmcmillan
#
# For the most up to date version of this file see:
# https://github.com/matt448/Digital_Dash_v2/blob/master/serialtest.py
#
@matt448
matt448 / backup_nagios.sh
Created Mar 13, 2013
Simple backup script for Nagios on Ubuntu 12.04
View backup_nagios.sh
#!/bin/bash
DATE=`date +%Y%m%d-%H%M`
sudo tar cfvz nagios_backup_$DATE.tgz /etc/nagios3 /etc/nagios-plugins /etc/nagios /usr/lib/nagios/plugins /usr/share/pnp4nagios/html /var/lib/pnp4nagios/perfdata /var/lib/nagios /var/lib/nagios3
You can’t perform that action at this time.