“EEPROM:read()”的版本间的差异

来自YFRobotwiki
跳转至: 导航搜索
第11行: 第11行:
  
 
Reads a byte from the EEPROM. Locations that have never been written to have the value of 255.
 
Reads a byte from the EEPROM. Locations that have never been written to have the value of 255.
 +
  
 
<font color="orange" size="+1">'''语法'''</font>
 
<font color="orange" size="+1">'''语法'''</font>
  
 
EEPROM.read(address)
 
EEPROM.read(address)
 +
  
 
<font color="orange" size="+1">'''参数'''</font>
 
<font color="orange" size="+1">'''参数'''</font>
  
 
address: the location to read from, starting from 0 (int)
 
address: the location to read from, starting from 0 (int)
 +
  
 
<font color="orange" size="+1">'''返回值'''</font>
 
<font color="orange" size="+1">'''返回值'''</font>
  
 
the value stored in that location (byte)
 
the value stored in that location (byte)
 +
  
 
<font color="orange" size="+1">'''示例'''</font>
 
<font color="orange" size="+1">'''示例'''</font>

2015年7月14日 (二) 10:26的版本

EEPROM

read()


描述

Reads a byte from the EEPROM. Locations that have never been written to have the value of 255.


语法

EEPROM.read(address)


参数

address: the location to read from, starting from 0 (int)


返回值

the value stored in that location (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);
}


返回EEPROM库

返回Arduino库菜单

返回首页

更多建议和问题欢迎反馈至 YFRobot论坛