?? read_page.c
字號:
//從24c04連續讀出16個字節的程序
//讀出數據通過led顯示
#include<iom16v.h>
#define uchar unsigned char
#define uint unsigned int
#include"i2c.h"
uchar aa[16];
//短延時函數
void s_ms(unsigned int t)
{
unsigned int i ;
for(;t>=1;t--)
{
}
}
//寫一個字節
main()
{
uchar i;
DDRD=0xff;
PORTD=0XFF;
i2c_init(); //初始化
i2c_rese(aa,0x00,16); //讀出16個字節,起始地址0x00
for(i=0;i<16;i++)
{
PORTD=~aa[i];
s_ms(60000);
s_ms(60000);
s_ms(60000);
s_ms(60000);
s_ms(60000);
s_ms(60000);
s_ms(60000);
s_ms(60000);
s_ms(60000);
s_ms(60000);
s_ms(60000);
s_ms(60000);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -