BASIC4MCU | 질문게시판 | 답변 : avr led 및 스위치 관련 질문드립니다.(인터럽트)-수정
페이지 정보
작성자 master 작성일2018-04-23 21:47 조회13,810회 댓글0건
https://www.basic4mcu.com/bbs/board.php?bo_table=gac&wr_id=606
본문
// MCU BASIC: https://www.basic4mcu.com// DateTime : 2018-04-23 오후 9:50:09// by Ok-Hyun Park2번 인터럽트가 ↑에서 걸리면 숫자를 1씩증가 시키고,7번 인터럽트가 ↓↑ 일때 1씩 증가하는 소스//#include <avr/io.h>#include <util/delay.h>//volatile unsigned char data=0;//ISR(INT2_vact){ data++; }ISR(INT7_vect){ data++; }//int main(void){unsigned char data=0x01;DDRA=0xff;EICRA=0x30; // int2 rising edgeEICRB=0x40; // int7 Any logical changeEIMSK=0x84;sei();while(1){ PORTA=data; }}
댓글 0
조회수 13,810등록된 댓글이 없습니다.