Skip to content

Instantly share code, notes, and snippets.

Michael Holachek holachek

Block or report user

Report or block holachek

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
@holachek
holachek / main.c
Last active Jan 3, 2016
A slightly modified main.c
View main.c
#define F_CPU 1000000 // CPU frequency for proper time calculation in delay function
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRD |= (1 << PD6); // make PD6 an output
for(;;)
@holachek
holachek / TechChange.c
Created Jul 15, 2013
TechChange Arduino Mood light! To run it this code, you'll need an Arduino Uno (or derivative), a piezo element, and a WS2801-compatible RGB LED (e.g., https://www.sparkfun.com/products/10504). You'll also need to download & install the FastSPI_LED library for Arduino: https://code.google.com/p/fastspi/
View TechChange.c
// TechChange Mood Lamp
// Version 0.1
// Michael Holachek
// Hardware:
// WS2801 LED connected to pins A3-A5
// Piezo element connected to pin 11 and ground
#include <FastSPI_LED.h>
@holachek
holachek / ToastieReflowOven_MASTER.ino
Last active Dec 16, 2015
Code for the Toastie Reflow Oven. Uses an Adafruit MAX31855 and Thermocouple, Serial LCD, piezo, relay, and fancy programming on an Arduino Mega. And, not to be forgotten: a shiny silver button.
View ToastieReflowOven_MASTER.ino
// Reflow Oven
// Master Controller Sketch
// By Michael Holachek
// Version 1.0
#include "Adafruit_MAX31855.h"
#include <SoftwareSerial.h>
@holachek
holachek / main.c
Created Nov 26, 2012
Even or Odd program
View main.c
// Tell me, is a number even or odd?
// Bug #1: Long integers cause scanf to truncate userNumber
#include <stdio.h>
int main()
{
int userNumber = 0;
@holachek
holachek / transcript.txt
Created Oct 29, 2012
Michael Holachek's Arduino AVR Video Tutorial transcript
View transcript.txt
In this video tutorial, I'm going to show you how to program an AVR microcontroller with the Arduino.
This allows you to expriment with individual AVR chips, without the cost or hassle of buying an AVR programmer.
Additionally, by learning how to program an AVR chip, you can understand how an Arduino works while making your own custom embedded system as small and inexpensive as possible.
I'll show you the process with an ATtiny2313 AVR and the Arduino Duemilanove.
If you’re using a different AVR chip, the pin connections will be slightly different.
Since we'll need the datasheet for reference, you'll probably want to download it now.
First, go to atmel.com, click in the search box, and type the name of your AVR.
Then, on the search results page, click the Datasheet link.
For this tutorial, you'll need:
An Arduino Duemilanove, Uno, or Mega;
@holachek
holachek / README.md
Created Sep 14, 2012
Virgin Mobile Minute Checker Python 3 Program
View README.md

Virgin Mobile Minute Texter

Never go over your minutes again

Introduction

The Virgin Mobile Minute Texter is a simple Python script that scrapes your data from Virgin Mobile's website and sends you a text with your remaining minutes. Currently only works on the Virgin Mobile USA site.

Setup

First, make sure you have Python 3 installed by typing which python3 in a terminal. If you see something like /usr/local/bin/python3, you're good to go. If you see an error, install Python 3.

Go to https://sendhub.com and register for a free account. You'll use this service to send text messages to your phone. The free plan lets you send up to 1000 messages and 500 API requests a month. Copy your API Key from the Settings page.

@holachek
holachek / macros.h
Created Aug 10, 2012
Convenient Arduino-like pin macros
View macros.h
// super awesome Arduino-like pin macros save you from having to remember bitmasks
// code from Matthew T. Pandina's Demystifying the TLC5940 tutorial:
// URL: https://sites.google.com/site/artcfox/demystifying-the-tlc5940
#define setOutput(ddr, pin) ((ddr) |= (1<< (pin)))
#define setLow(port, pin) ((port) &= ~(1 << (pin)))
#define setHigh(port, pin) ((port) |= (1 << (pin)))
#define outputState(port, pin) ((port) & (1 << (pin)))
#define pulse(port, pin) do { \
setHigh((port), (pin)); \
@holachek
holachek / main.c
Created Aug 10, 2012
Toggle PD6 every second using AVR timers
View main.c
#define LEDPORT PORTD
#define LEDBIT PD6
#define LEDDDR DDRD
#include <avr/io.h>
int main (void)
{
LEDDDR |= (1 << LEDBIT); // set LED pin as an output
TCCR1B |= ((1 << CS10) | (1 << CS11)); // configure timer prescaling
@holachek
holachek / Makefile
Created Aug 9, 2012
AVR Tutorial Makefile
View Makefile
# Name: Makefile
# Author: <insert your name here>
# Copyright: <insert your copyright message here>
# License: <insert your license reference here>
# DEVICE ....... The AVR device you compile for
# CLOCK ........ Target AVR clock rate in Hertz
# OBJECTS ...... The object files created from your source files. This list is
# usually the same as the list of source files with suffix ".o".
# PROGRAMMER ... Options to avrdude which define the hardware you use for
@holachek
holachek / main.c
Last active Nov 28, 2018
AVR Tutorial main.c
View main.c
#define F_CPU 1000000 // CPU frequency for proper time calculation in delay function
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRD |= (1 << PD6); // make PD6 an output
for(;;)
You can’t perform that action at this time.