📄 1.c
字号:
#include < iom16v.h>
#include <macros.h>
#include "lcd1602.h"
unsigned char disp[] = {0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};
void delayms(void)
{
char a;
for(a=0;a<141;a++)
;
}
void delay(int a)
{
int b;
for(b=0;b<a;b++)
delayms();
}
void Spi_init()
{
DDRB|=(1<<6);
SPCR=0xE3;
SPSR=0x00;
}
void main()
{
char *str="receive data :";
DDRA=0xFF;
PORTA=0x00;
DDRB=0xFF;
PORTB=0x00;
DDRC=0x00;
PORTC=0x00;
DDRD=0x00;
PORTD=0x00;
SEI();
Spi_init();
LCD_init();
LCD_write_str(0,0,str);
while(1);
}
#pragma interrupt_handler in:11
void in()
{
char temp[3];
temp[2]= (SPDR /100)%10+'0';
temp[1] = (SPDR /10) %10+'0';
temp[0] = (SPDR % 10)+'0';
LCD_write_char(11,1,temp[2]);
LCD_write_char(12,1,temp[1]);
LCD_write_char(13,1,temp[0]);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -