创客百科

姿势共享,有节操无门槛参与的创客百科,创客动力之源 \ (^_^) /

用户工具

站点工具


en:arduino:libraries:eepromread

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

en:arduino:libraries:eepromread [2016/12/25 22:15]
en:arduino:libraries:eepromread [2016/12/25 22:15] (当前版本)
行 1: 行 1:
 +[[en:​arduino:​libraries:​eeprom|EEPROM]]
 +====== read() ======
  
 +
 +===== Description =====
 +
 +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 =====
 +<code cpp>
 +#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);
 +}
 +</​code>​
 +
 +
 +[[en:​arduino:​libraries|Reference Home]]
en/arduino/libraries/eepromread.txt · 最后更改: 2016/12/25 22:15 (外部编辑)