BASIC4MCU | 질문게시판 | 답변 : 답변 : 답변 : 프로테우스 문제 질문있습니다.
페이지 정보
작성자 master 작성일2018-12-18 16:24 조회3,335회 댓글0건
https://www.basic4mcu.com/bbs/board.php?bo_table=gac&wr_id=7023
본문
// MCU BASIC: https://www.basic4mcu.com// DateTime : 2018-12-18 오후 4:29:49// by Ok-Hyun Park//#define F_CPU 16000000#include <avr/io.h>#include <avr/interrupt.h>#include <util/delay.h>//volatile char FND[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x27,0x7F,0x6F,0x3f};volatile int cnt=0,mode=0;//ISR(INT0_vect){ mode=1; }ISR(INT1_vect){ mode=0; }//ISR(TIMER1_COMPA_vect){ // 500msif(mode==1){ if(cnt<999)cnt++; }if(mode==0){ if(cnt> 0)cnt--; }PORTA=FND[cnt/100];PORTB=FND[cnt/10%10];PORTC=FND[cnt%10];}//int main(){DDRA=0xFF; DDRB=0xFF; DDRC=0xFF;TCCR1B=0x0C; OCR1A=31249; TIMSK=0x10; //500msEICRA=0xAA; EIMSK=0x03; //falling edgeSREG=0x80;while(1);return 0;}
댓글 0
조회수 3,335등록된 댓글이 없습니다.