led.c
来自「avr常用功能程序中包含了pwm、adc、中断、定时、i2c等各程序可供开发者直」· C语言 代码 · 共 41 行
C
41 行
#include <avr/io.h>
#include <stdlib.h>
int main(void)
{
unsigned int t,times;
DDRB=0XFF;
DDRD=0XFF;
DDRA=0XFF;
while(1)
{PORTB=0xF3;
PORTA=0xF3;
}
/*
PORTB=0x00;
PORTD=0XFF;
for(times=0;times<=10;times++)
{
for(t=0;t<=50000;t++);
}
PORTB=0XFF;
PORTD=0X00;
for(times=0;times<=10;times++)
{
for(t=0;t<=50000;t++);
}
}
/* unsigned char i,j;
for(i=0;;i++)
{
j=i;
DDRB=0X00;
PORTB=j;
}
while(1)
{;}
return 0;*/
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?