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.