EEPROM:EEPROM

從 YFRobotwiki
跳到: 導覽搜尋
EEPROM

EEPROM[]


描述

這個操作符允許像一個數組一樣使用標識符'EEPROM'。使用這種方式可以直接對EEPROM單元進行讀取和寫入操作。


語法

EEPROM[address]


參數

address: 讀/寫的位置,從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論壇