본문 바로가기
반응형

분류 전체보기38

[Acumen 270] LED + SWITCH + Edge Trigger 2015. 7. 23.
[Acumen 270] LED + SWITCH + Level Trigger 2015. 7. 23.
[2014 한이음 동상수상] Golden Box 2015. 7. 23.
[AVR Studio](atmega 128) Timer #include#define F_CPU 16000000UL#include#include"led.h"#include"segment.h"#include unsigned char TovVal = 0; int count = 0; void LED_BLINK(void){PORTA = 0x00;disp_seg(count % 60);_delay_ms(300);PORTA = 0xFF;} SIGNAL(SIG_OVERFLOW1){TCNT1 =0xFFFF - 0X3DB8; TovVal++; count++;if(TovVal == 1){LED_BLINK();TovVal = 0;} sei();} int main(){cli(); DDRA = 0XFF;DDRF = 0xFF;DDRB = 0xff;DDRC = 0xff; TCCR1A = .. 2015. 7. 23.
[AVR Studio](atmega 128) 키보드 피아노 #defineBAUD_9600103unsigned char send_char = 0;#include #define F_CPU 16000000UL#include #include "led.h"#include "segment.h"#include #include #define MAX_RXBUF_SIZE 128 unsigned char rx_buf[MAX_RXBUF_SIZE];#define FREQ(x) (unsigned int)(16000000/(2*8*(x))) unsigned int note_freg[7]={440,493,523,587,659,698,783};int buf_len=0; void stop(void){ TCCR3A = 0x00; TCCR3B = 0x00; TCNT3 = 0; ICR3 =0; DD.. 2015. 7. 23.
[AVR Studio](atmega 128) led shift control #include #include #ifndef __LED_H__#define __LED_H__ void led_all_onoff(int num,int cycle);void led_alternating_onoff(int num,int cycle);void led_shift(int num,int cycle); #endif #define F_CPU 16000000UL void led_all_onoff(int num, int cycle){int i=0;for(i;i 2015. 7. 23.
Avr studio) atmega128 계산기 프로그램 _ 인터럽트 사용 #include#define F_CPU 16000000UL#include #include #include "led.h"#include "segment.h" int add=0;int num1=0;int num2=0;int flag =0;int temp=0;int sum=0; SIGNAL(SIG_INTERRUPT0){sei();_delay_ms(100);unsigned char ary[4]={0x77,0x6D,0x37,0x5E};unsigned char yun[4]={0x5E,0x3E,0x37,0x06}; _delay_ms(100);if(add%4==0){PORTC = ary[0];PORTF = yun[0];}else if(add%4==1){PORTC = ary[1];PORTF = yun[1];}else i.. 2015. 7. 23.
Huffman 코딩 (구현한 부분까지) #include #include #include #define MAX_ELEMENT 100typedef struct heap{char ch; //문자int num; //발생빈도struct heap *left;struct heap *right;}Huff_node;struct node{char ch; //문자int num; // 발생빈도.struct node *next;};struct element{char ch;char *p;};//기록하고 남은 데이터가 저장되는 공간int wbdata = 0;//남은 데이터가 몇 비트인지 저장하는 변수int remBit = 0;int size;struct node *head = 0;Huff_node Huffman[MAX_ELEMENT];struct node list[MA.. 2015. 7. 23.
Sudoku 정답이 맞는지 확인하는 프로그램 #include #include #define SZ 9int sudoku[SZ][SZ]; int verify(int row, int column){int i, j;int cp_row = row / 3;int cp_column = column / 3; for (i = 0; i 2015. 7. 23.
반응형