Skip to content

Instantly share code, notes, and snippets.

View brightcloudy's full-sized avatar

Ryan Karl brightcloudy

View GitHub Profile
DataObjects::URI.new with arguments is deprecated, use a Hash of URI components (/usr/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:231:in `new')
** Invoke fetch:get_games (first_time)
** Execute fetch:get_games
rake aborted!
ClanScoreEntry#save returned false, ClanScoreEntry was not saved
/usr/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/resource.rb:1197:in `assert_save_successful'
/usr/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/resource.rb:407:in `save'
/usr/lib/ruby/gems/1.8/gems/dm-validations-1.1.0/lib/dm-validations.rb:69:in `save'
/usr/lib/ruby/gems/1.8/gems/dm-validations-1.1.0/lib/dm-validations/support/context.rb:30:in `validation_context'
#include <avr/io.h>
#include <avr/interrupt.h>
volatile uint8_t rwflags = 0b00000001;
volatile uint8_t bit = 0;
int main(void)
{
volatile uint8_t byte = 0b10101010;
DDRD |= (1 << 0) | (1 << 1); //portd0 portd1 output
#include <avr/io.h>
#include <avr/interrupt.h>
int main(void) {
cli(); // disable interrupts for prescaler set
CLKPR = (1 << CLKPCE); // set prescaler 1x
CLKPR = 0;
sei();
DDRD |= (1 << 0) | (1 << 1); //portd0 portd1 output
PORTD &= ~(1 << 0); //ensure portd0 low
#include <avr/io.h>
#include <avr/interrupt.h>
void init_clock(void);
void init_io(void);
void init_timers(void);
void load_addr(uint8_t addr);
uint8_t read(void);
void chip_enable(void);
void chip_disable(void);
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/sleep.h>
#include "init.h"
#include "spi.h"
#include "tlc5628.h"
int main(void) {
volatile uint8_t i = 0;
static uint8_t sine[256] = {127, 130, 133, 136, 139, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, 173, 176, 178, 181, 184, 187, 190, 192, 195, 198, 200, 203, 205, 208, 210, 212, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 234, 236, 238, 239, 240, 242, 243, 244, 245, 247, 248, 249, 249, 250, 251, 252, 252, 253, 253, 253, 254, 254, 254, 254, 254, 254, 254, 253, 253, 253, 252, 252, 251, 250, 249, 249, 248, 247, 245, 244, 243, 242, 240, 239, 238, 236, 234, 233, 231, 229, 227, 225, 223, 221, 219, 217, 215, 212, 210, 208, 205, 203, 200, 198, 195, 192, 190, 187, 184, 181, 178, 176, 173, 170, 167, 164, 161, 158, 155, 152, 149, 146, 143, 139, 136, 133, 130, 127, 124, 121, 118, 115, 111, 108, 105, 102, 99, 96, 93, 90, 87, 84, 81, 78, 76, 73, 70, 67, 64, 62, 59, 56, 54, 51, 49, 46, 44, 42, 39, 37, 35, 33, 31, 29, 27, 25, 23, 21, 20, 18, 16, 1
>>> for i in range(0,255):
... o = float(i * float((2*math.pi) / 256))
... p = math.sin(o) * 127 + 127
... print str(int(round(p))) + ",",
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/sleep.h>
#include <avr/pgmspace.h>
#include "init.h"
#include "spi.h"
static uint8_t sine[256] PROGMEM = {127, 130, 133, 136, 139, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, 173, 176, 178, 181, 184, 187, 190, 192, 195, 198, 200, 203, 205, 208, 210, 212, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 234, 236, 238, 239, 240, 242, 243, 244, 245, 247, 248, 249, 249, 250, 251, 252, 252, 253, 253, 253, 254, 254, 254, 254, 254, 254, 254, 253, 253, 253, 252, 252, 251, 250, 249, 249, 248, 247, 245, 244, 243, 242, 240, 239, 238, 236, 234, 233, 231, 229, 227, 225, 223, 221, 219, 217, 215, 212, 210, 208, 205, 203, 200, 198, 195, 192, 190, 187, 184, 181, 178, 176, 173, 170, 167, 164, 161, 158, 155, 152, 149, 146, 143, 139, 136, 133, 130, 127, 124, 121, 118, 115, 111, 108, 105, 102, 99, 96, 93, 90, 87, 84, 81, 78, 76, 73, 70, 67, 64, 62, 59, 56, 54, 51, 49, 46, 44, 42, 39, 37, 35, 33, 31, 29, 27, 25, 23, 21, 20, 18, 16, 15, 14, 12, 11, 10, 9, 7, 6, 5,
.file "paralleldac.c"
__SREG__ = 0x3f
__SP_H__ = 0x3e
__SP_L__ = 0x3d
__CCP__ = 0x34
__tmp_reg__ = 0
__zero_reg__ = 1
.section .text.interruptInit,"ax",@progbits
.global interruptInit
.type interruptInit, @function
#pragma once
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/sleep.h>
#include "init.h"
static inline void initializeI2C(void);
void sendCommand(uint8_t data);
uint8_t readReply(void);
uint8_t readAck(void);
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 16:01:31 01/20/2015
// Design Name:
// Module Name: mcp3202
// Project Name:
// Target Devices: