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

来自YFRobotwiki
跳转至: 导航搜索
第58行: 第58行:
 
----
 
----
  
[[EEPROM库|返回EEPROM 列表]]
+
[[EEPROM库|返回EEPROM ]]
  
[[Arduino库|返 库列表]]
+
[[Arduino库|返 回Arduino 库列表]]
  
 
[[首页|返回首页]]
 
[[首页|返回首页]]

2015年7月13日 (一) 21:17的版本

EEPROM

read()

描述

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

Syntax

EEPROM.read(address)

Parameters

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

Returns

the value stored in that location (byte)

Example

#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库列表

返回首页