setBank()

Description

選擇要用哪一種類型的虛擬 EEPROM。

從 86Duino Coding 102 版本以後才能使用這個函式。86Duino Coding 101 或更早的版本,你應該要使用 set_bank() 來代替。

語法


EEPROM.setBank(bank)

參數

bank: 指定要使用的虛擬 EEPROM 類型,EEPROM_16K 是 16K 大小的 flash 虛擬 EEPROM,EEPROM_200B 是 200-byte 大小的 CMOS 虛擬 EEPROM。預設的類型是 EEPROM_16K

回傳

無回傳值

範例


#include <EEPROM.h>

void setup()
{
  EEPROM.setBank(EEPROM_200B);
  for (int i = 0; i < 200; i++)
    EEPROM.write(i, i & 0xff);

  EEPROM.setBank(EEPROM_16K);
  for (int i = 0; i < 16000; i++)
    EEPROM.write(i, i & 0xff);
}

void loop()
{
} 

See also

EEPROM.read()
EEPROM.write()


函式庫參考主頁面

The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.