EEPROM:EEPROM

来自YFRobotwiki
2015年7月14日 (二) 10:36Admin讨论 | 贡献的版本

跳转至: 导航搜索
EEPROM

EEPROM[]


描述

This operator allows using the identifier `EEPROM` like an array. EEPROM cells can be read and written directly using this method.


语法

EEPROM[address]


参数

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


返回值

A reference to the EEPROM cell


示例

#include <EEPROM.h>

void setup(){

  unsigned char val;

  //Read first EEPROM cell.
  val = EEPROM[ 0 ];

  //Write first EEPROM cell.
  EEPROM[ 0 ] = val;

  //Compare contents
  if( val == EEPROM[ 0 ] ){
    //Do something...
  }
}

void loop(){ /* Empty loop */ }


返回EEPROM库

返回Arduino库菜单

返回首页

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