Difference between revisions of "EEPROM.read"

From Gamebuino Wiki
Jump to: navigation, search
(Create the page)
 
(Fix some bug)
Line 1: Line 1:
{{lowercase}}
 
 
__NOTOC__
 
__NOTOC__
 
== Description ==
 
== Description ==
Line 14: Line 13:
  
 
== Example ==
 
== Example ==
 +
<code>
 
#include <EEPROM.h>
 
#include <EEPROM.h>
 
#include <SPI.h>
 
#include <SPI.h>
Line 34: Line 34:
 
* [[EEPROM.put]]
 
* [[EEPROM.put]]
 
* [[EEPROM.get]]
 
* [[EEPROM.get]]
 +
</code>

Revision as of 2016-11-26T23:33:05

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

  1. include <EEPROM.h>
  2. include <SPI.h>
  3. include <Gamebuino.h>

Gamebuino gb;

byte levels_unlocked = 0;

void setup() {

 gb.begin();
 gb.titleScreen(F("Read EEPROM"));
 levels_unlocked = EEPROM.read(0);

}

See also