Skip to content

Instantly share code, notes, and snippets.

// spi.c
//
// Example program for bcm2835 library
// Shows how to interface with SPI to transfer a byte to and from an SPI device
//
// After installing bcm2835, you can build this
// with something like:
// gcc -o spi spi.c -l bcm2835
// sudo ./spi
//
@theapi
theapi / boards.txt
Last active August 29, 2015 14:17
ATmega328 on a breadboard (8 MHz internal clock)
atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)
atmega328bb.upload.protocol=stk500
atmega328bb.upload.maximum_size=30720
atmega328bb.upload.speed=57600
atmega328bb.bootloader.low_fuses=0xE2
atmega328bb.bootloader.high_fuses=0xDA
atmega328bb.bootloader.extended_fuses=0x05
atmega328bb.bootloader.path=arduino:atmega
atmega328bb.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
@theapi
theapi / reset.php
Created September 23, 2014 18:13
Reset button for MythTv
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
g/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Reset XBMC</title>
<link rel="shortcut icon" href="/reset_xbmc.ico">
<style>
input#reset{
width:200px; /*same as the height*/
@theapi
theapi / .avrduderc
Created August 4, 2014 22:19
Setting for Arduino IDE to slow down the USBASP programmer for the ATTINY85 at 1mhz
default_bitclock = 10;
@theapi
theapi / blink_fade.ino
Created June 12, 2014 08:56
Blink Fade without delay
@theapi
theapi / avr_timer0.txt
Last active August 29, 2015 13:55
Notes from Bruce Land video - microcontrollers #2
// see http://people.ece.cornell.edu/land/courses/ece4760/labs/s2012/Sched1GCC644.c
// see http://people.ece.cornell.edu/land/courses/ece4760/Timers/index.html
//**********************************************************
//timer 0 compare ISR
ISR (TIMER0_COMPA_vect)
{
// Called every millis
// 75 cycles in
/*
Shift Register Example
for 74HC595 shift register
*/
//Pin connected to latch pin (ST_CP) of 74HC595
const int latchPin = 13;
//Pin connected to clock pin (SH_CP) of 74HC595
const int clockPin = 12;
////Pin connected to Data in (DS) of 74HC595
@theapi
theapi / shift_register.c
Created January 27, 2014 19:30
Attiny85 avr-c shift register 74HC595
//#define F_CPU 16000000L
#include <avr/io.h>
#include <util/delay.h>
#define PIN_DATA PB0 // DS
#define PIN_CLOCK PB1 // SH_CP
#define PIN_LATCH PB2 // ST_CP
// From Android.h
@theapi
theapi / blinkc_nodelay.c
Last active January 3, 2016 22:49
Port manipulation using a timer interrupt instead of delay
/*
* main.c
* ATmega328p port manipulation
*/
/********************************************************************************
Includes
********************************************************************************/
#include <avr/io.h>
@theapi
theapi / blinkc.c
Created January 20, 2014 13:20
Port manipulation in avr-c
/*
* main.c
*
* Created on: 19 Jan 2014
* Author: peter
*/
//#define F_CPU 16000000L
#include <avr/io.h>
#include <util/delay.h>