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 <avr/io.h> | |
void USART_Init( unsigned int ubrr){ | |
/* Set baud rate */ | |
UBRR1H = (unsigned char)(ubrr>>8); | |
UBRR1L = (unsigned char)ubrr; | |
/* Enable receiver and transmitter */ | |
UCSR1B = (1<<RXEN1)|(1<<TXEN1); | |
/* Set frame format: 8data, 2stop bit */ | |
UCSR1C = (1<<USBS1)|(1<<UCSZ11)|(1<<UCSZ10); |
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 <avr/io.h> | |
#include <avr/interrupt.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define C2 | |
#define DDR_SPI DDRB | |
#define PORT_SPI PORTB | |
#define DD_MOSI DDB2 |
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 <avr/io.h> | |
void sleep(const int milliseconds) { | |
for (int j = 0; j < milliseconds; j++) { | |
for (int i = 0; i < (8000 / 18 - 28); i++); | |
} | |
} | |
int main() | |
{ |
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 <avr/io.h> | |
#include <avr/interrupt.h> | |
#include <util/delay.h> | |
void display_internal(uint8_t mask, uint8_t c) | |
{ | |
uint8_t bm = mask == 0x0F ? 0b00000000 : 0b00001000; | |
uint8_t sh = mask == 0x0F ? 0 : 4; | |
if ((c & mask) >> sh == 0x00) { |
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 <avr/io.h> | |
#include <avr/interrupt.h> | |
#include <util/delay.h> | |
void display_internal(uint8_t mask, uint8_t c) | |
{ | |
uint8_t bm = mask == 0x0F ? 0b00000000 : 0b00001000; | |
uint8_t sh = mask == 0x0F ? 0 : 4; | |
if ((c & mask) >> sh == 0x00) { |
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
/* | |
* GccApplication1.c | |
* | |
* Created: 19.11.2013 13:22:54 | |
* Author: ese1-30 | |
*/ | |
#include <avr/io.h> | |
#include <util/delay.h> |


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 "title_and_description_delegate.h" | |
void TitleAndDescriptionDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const | |
{ | |
m_paintingIndex = index; | |
QItemDelegate::paint(painter, option, index); | |
} | |
void TitleAndDescriptionDelegate::drawDisplay(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, const QString &text) const | |
{ |
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/env python | |
# -*- coding: utf-8 -*- | |
import unittest | |
def multiply(A, B): | |
if len(A) == 1: | |
return [[ A[0][0] * B[0][0] ]] | |
elif len(A) % 2 == 1: | |
return shrink(multiply(expand(A), expand(B))) |