-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
52 lines (50 loc) · 845 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "OLED12864.h"
#include "OLED_codeTab.h"
int main( void )
{
u8 ACK=0;
CLK_CKDIVR=0X00;
delay(200);
uart1_init();
I2C_init();
printf("²âÊÔIICÑ°Ö·at24c02:\r\n");
I2C_Start();
ACK=I2C_WBit(0XA0);
if (ACK)
{
printf("there's no at24c02\r\n");
}
else
{
printf("FIND a at24c02!\r\n");
}
I2C_Stop();
ACK=0;
printf("²âÊÔIICÑ°Ö·OLED12864:\r\n");
I2C_Start();
ACK=I2C_WBit(0X78);
if (ACK)
{
printf("there's no OLED12864\r\n");
}
else
{
printf("FIND a OLED12864\r\n");
}
I2C_Stop();
ACK=0;
printf("²âÊÔIICÑ°Ö·fake hardwear:\r\n");
I2C_Start();
ACK=I2C_WBit(0X89);
if (ACK)
{
printf("there's no hardwear\r\n");
}
else
{
printf("FIND a hardwear\r\n");
}
I2C_Stop();
ACK=0;
OLED_Display();
}