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 / speed_test.py
Created Sep 5, 2014
BeagleBone Black TFT Display Testing
View speed_test.py
#!/usr/bin/python
import Image
import ImageDraw
import ImageFont
import glob
import Adafruit_BBIO.ADC as ADC
import time
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 / 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
@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 / 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 / tft_test.ino
Last active Nov 3, 2017
This is a simple sketch I used to test the refresh rate of an Adafruit 2.2" TFT display on an Arduino Mega 2560. http://www.adafruit.com/products/1480
View tft_test.ino
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9340.h"
#if defined(__SAM3X8E__)
#undef __FlashStringHelper::F(string_literal)
#define F(string_literal) string_literal
#endif
// These are the pins used for the Mega
@matt448
matt448 / contacts.cfg
Created Dec 31, 2013
Nagios configuration lines for adding Slack to contacts.
View contacts.cfg
define contact {
contact_name slack
alias Slack
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-service-by-slack
host_notification_commands notify-host-by-slack
}
@matt448
matt448 / commands.cfg
Created Dec 31, 2013
Configuration to be added to existing commands.cfg. This tells how to use the slack_nagios.sh script.
View commands.cfg
###############################
# Slack notifications
###############################
# 'notify-service-by-slack' command definition
define command {
command_name notify-service-by-slack
command_line /usr/local/bin/slack_nagios.sh > /tmp/slack.log 2>&1
}
@matt448
matt448 / slack_nagios.sh
Last active Apr 22, 2019
Script to post Nagios notifications into a Slack channel
View slack_nagios.sh
#!/bin/bash
# This script is used by Nagios to post alerts into a Slack channel
# using the Incoming WebHooks integration. Create the channel, botname
# and integration first and then add this notification script in your
# Nagios configuration.
#
# All variables that start with NAGIOS_ are provided by Nagios as
# environment variables when an notification is generated.
# A list of the env variables is available here:
@matt448
matt448 / SPI_Digital_Pot_AD8403.ino
Created Oct 24, 2013
Example code for controlling an AD8403 Digital Potentiometer. Please see https://github.com/matt448/arduino for the latest version of this code.
View SPI_Digital_Pot_AD8403.ino
/*
Digital Pot Control
This example controls an Analog Devices AD8403 digital potentiometer.
The AD8403 has 4 potentiometer channels. Each channel's pins are labeled
A - connect this to voltage
W - this is the pot's wiper, which changes when you set it
B - connect this to ground.
The AD8403 is SPI-compatible. To command it you send two bytes.
You can’t perform that action at this time.