“EEPROM:read()”的版本间的差异
来自YFRobotwiki
| (未显示1个用户的7个中间版本) | |||
| 第4行: | 第4行: | ||
|- | |- | ||
|width="100%" valign="top" align="left"| | |width="100%" valign="top" align="left"| | ||
| − | <font color="olivedrab" size="+ | + | <font color="olivedrab" size="+3">'''read()'''</font> |
| + | |||
| + | |||
<font color="orange" size="+1">'''描述'''</font> | <font color="orange" size="+1">'''描述'''</font> | ||
| − | + | 从EEPROM中读取一个字节。从没被写过的位置默认值为255。 | |
| + | |||
| − | <font color="orange" size="+1">''' | + | <font color="orange" size="+1">''' 语法'''</font> |
EEPROM.read(address) | EEPROM.read(address) | ||
| − | |||
| − | + | <font color="orange" size="+1">'''参数'''</font> | |
| − | + | address: 读取的位置,从0开始 (int 整型) | |
| − | |||
| − | <font color="orange" size="+1">''' | + | <font color="orange" size="+1">''' 返回值'''</font> |
| + | 存储在该位置的值 (byte型) | ||
| + | |||
| + | |||
| + | <font color="orange" size="+1">'''示例'''</font> | ||
| + | |||
| + | <pre style="color:dimgray"> | ||
#include <EEPROM.h> | #include <EEPROM.h> | ||
| 第50行: | 第57行: | ||
delay(500); | delay(500); | ||
} | } | ||
| + | |||
| + | </pre> | ||
|} | |} | ||
| 第55行: | 第64行: | ||
---- | ---- | ||
| − | [[EEPROM库|返回EEPROM | + | [[EEPROM库|返回EEPROM 库]] |
| + | |||
| + | [[Arduino库|返回Arduino库菜单]] | ||
| + | |||
| + | [[首页|返回首页]] | ||
| + | |||
| + | 更多建议和问题欢迎反馈至 [http://www.yfrobot.com YFRobot论坛] | ||
2015年7月14日 (二) 10:42的最后版本
|
read()
描述 从EEPROM中读取一个字节。从没被写过的位置默认值为255。
EEPROM.read(address)
address: 读取的位置,从0开始 (int 整型)
存储在该位置的值 (byte型)
#include <EEPROM.h>
int a = 0;
int value;
void setup()
{
Serial.begin(9600);
}
void loop()
{
value = EEPROM.read(a);
Serial.print(a);
Serial.print("\t");
Serial.print(value);
Serial.println();
a = a + 1;
if (a == 512)
a = 0;
delay(500);
}
|
更多建议和问题欢迎反馈至 YFRobot论坛