Home > other >  The great god can help? Trouble, thank you
The great god can help? Trouble, thank you

Time:09-21

Error: (1) C (352) : error C267: 'AT24C02Read' : the requires ANSI - style prototype



@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @




/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* the function name: void At24c02Write (unsigned char addr, unsigned char dat)
* functions: 24 of our fleet to an address into a data
* input: no
No
* output:* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Void AT24C02Write (unsigned char addr, unsigned char dat)
{
I2cStart ();
Xa0 I2cSendByte (0);//send a device address
I2cSendByte (addr);//sent to write memory address
I2cSendByte (dat);//send data
I2cStop ();
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* the function name: unsigned char At24c02Read (unsigned char addr)
* function function: read 24 our fleet of an address of a data
* input: no
No
* output:* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Unsigned char At24C02Read (uchar addr, uchar num)
{

I2cStart ();
Xa0 I2cSendByte (0);//send a device address
I2cSendByte (addr);//sent to read address
I2cStart ();
I2cSendByte xa1 (0);//send reading device address
Num=I2cReadByte ();//read the data
I2cStop ();
Return num.
}

//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//







Void Start_display ()
{

Error: if (AT24C02Read (255).=18)
{
AT24C02Write (0, Set_temp_H);
AT24C02Write (2, Set_temp_L);
AT24C02Write (255);
}
The else
{
Set_temp_H=AT24C02Read (0);
Set_temp_L=AT24C02Read (2);
}

LCD_Dispstring (2, 0, "Temp:");
LCD_Dispstring (0, 1, "Max:");
LCD_Dispstring (9, 1, "Min:");
}

CodePudding user response:

AT24C02Read defined as two parameters, and use it every time it is a parameter

CodePudding user response:

That there should be how to change ah, thank you

CodePudding user response:

refer to the second floor Augustus, Dallas, Anton response:
here how to change the world, thank you


You declare the function is
Unsigned char At24C02Read (uchar addr, uchar num)
Call is At24C02Read (addr)

You need to change the function declaration, such as
Unsigned char At24C02Read (uchar addr)
{
Uchar num.
,,,,,,,
}
  • Related