This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import Image | |
import ImageDraw | |
import ImageFont | |
import glob | |
import Adafruit_BBIO.ADC as ADC | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Matthew McMillan | |
@matthewmcmillan | |
http://matthewcmcmillan.blogspot.com | |
Created 12 Mar 2014 | |
Digital Pot Control (MCP4251) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################### | |
# 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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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. |