您的位置 首页 被动

AVR单片的外部中止使用规划

AVR单片的外部中断应用设计-#include

#include

#include interrupt.h》

void port_init(void)

{

DDRB = 0xff;

PORTB = 0xff;

DDRD = 0x00;

PORTD |= (1 《《 2);

#include

#include

#include interrupt.h》

void port_init(void)

{

DDRB = 0xff;

PORTB = 0xff;

DDRD = 0x00;

PORTD |= (1 《《 2);


AVR单片的外部中止使用规划

}

int main(void)

{

port_init();

GICR |= (1 《《 INT0);

sei();

while(1)

{

;

}

}

ISR(INT0_vect)

{

PORTB = 0xfe;

_delay_ms(500);

PORTB = 0xff;

_delay_ms(500);

}

声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/ziliao/beidong/346363.html

为您推荐

联系我们

联系我们

在线咨询: QQ交谈

邮箱: kf@86ic.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

返回顶部