Difference between revisions of "EEPROM.read"
From Gamebuino Wiki
(Fix a bug) |
(Fix another bug) |
||
Line 14: | Line 14: | ||
== Example == | == Example == | ||
<code> | <code> | ||
− | #include <EEPROM.h> | + | #include <EEPROM.h> |
− | #include <SPI.h> | + | #include <SPI.h> |
− | #include <Gamebuino.h> | + | #include <Gamebuino.h> |
+ | |||
+ | Gamebuino gb; | ||
+ | |||
+ | byte levels_unlocked = 0; | ||
− | + | void setup() | |
− | + | { | |
− | + | gb.begin(); | |
− | + | gb.titleScreen(F("Read EEPROM")); | |
− | void setup() | + | levels_unlocked = EEPROM.read(0); |
− | { | + | } |
− | |||
− | |||
− | |||
− | } | ||
</code> | </code> | ||
Revision as of 2016-11-27T00:36:48
Description
Read the value corresponding to the adress
Syntax
EEPROM.read(address);
Parameters
- address: the location to read from, starting from 0 (int)
Returns
The value stored in that location
Example
#include <EEPROM.h> #include <SPI.h> #include <Gamebuino.h> Gamebuino gb; byte levels_unlocked = 0;
void setup() { gb.begin(); gb.titleScreen(F("Read EEPROM")); levels_unlocked = EEPROM.read(0); }